# SHIFT

The SHIFT formula returns the date after shifting a date either backwards or forwards by a specified time period, like a month, quarter, or year.

## Syntax

```javascript
SHIFT(inputDate, <offset interval>)
```

## Arguments

inputDate– The date to be shifted. Required.

offset interval - The preset format model, like month("M"), quarter("Q) or year("Y"). Required.

## Return value

Returns a date after shifting the input date by the specified number of months, quarters, etc.

## Example

```javascript
SHIFT(CURRENT_PERIOD, "2M")
//Shifts the date by 2 months

SHIFT(TODAY(), "6M")
//If the current date is 01/09/2023, it returns 01/03/2024
```

We've used SHIFT to shift each month by 2 months. For example, for January, the SHIFT function returns March 01st.

<figure><img src="/files/xQ02hVr0mQzLOaHDdNqg" alt=""><figcaption><p>SHIFT function</p></figcaption></figure>

You can also use SHIFT with forecast open and closed periods. In this example, we've shifted the forecast open period end date backwards by 2 quarters.

<figure><img src="/files/AhV0AVla3tJpqpKeI9HI" alt=""><figcaption><p>SHIFT for forecast open and closed periods</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.inforiver.com/formula-syntax/time-intelligence-functions/shift.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
