<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b979e87e-5fe4-4ff5-bd26-a2d2497c9861/Wave_Styled.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b979e87e-5fe4-4ff5-bd26-a2d2497c9861/Wave_Styled.png" width="40px" /> This formula calculates the number of quarters between the current calendar quarter and quarter of another date.

This is an alternative to using the dateBetween() function, which calculates the number of quarters between two dates based on the number of days between those dates.

I created this while working on a template for company OKRs. Since OKRs are often set each quarter, this formula lets me create a table of OKRs for several quarters, then filter that table to see the OKRs for "this quarter".

If you have any questions then please feel free to add a comment.

</aside>

When a date column contains a start and end date, the formula will be based on the start date by default

When a date column contains a start and end date, the formula will be based on the start date by default

Contents

<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/68fbb2d5-bab2-4fbe-8af1-e02d4eb37ed6/Validation_Styled.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/68fbb2d5-bab2-4fbe-8af1-e02d4eb37ed6/Validation_Styled.png" width="40px" /> If you get an error message about a ‘syntax error’ when copying and pasting these formulas, try copying the ‘Unformatted formula’ from the toggle list instead.

</aside>

Get year from date

toNumber(formatDate(prop("Date"), "Y")

Calculate the number of years between the current date and another date

toNumber(formatDate(prop("Date"), "Y")) - toNumber(formatDate(now(), "Y"))

Add or subtract quarters, if the date is in previous or future years

(toNumber(formatDate(prop("Date"), "Y")) - toNumber(formatDate(now(), "Y"))) * 4

Get the quarter from date

toNumber(formatDate(prop("Date"), "Q") )