All posts

Working with nonstandard fiscal years in formula fields

Most Salesforce users are familiar with fiscal quarters that start neatly on the first of a month — January 1, April 1, July 1, and October 1. But what…

Most Salesforce users are familiar with fiscal quarters that start neatly on the first of a month — January 1, April 1, July 1, and October 1. But what happens when your organization’s fiscal year starts mid-month, like April 6 or January 8? Or when you’re using a 4-4-5 retail fiscal year?

Salesforce has Custom Fiscal Year support that work well for reporting and forecasting, but when you want to build formula fields to drive logic — like checking if a date field falls in the current fiscal quarter — you’re on your own. This might be used in validation rules, automations, or list view filters, which aren’t supported by the out of the box custom fiscal year configuration.

This post walks through a fully formula-based, maintainable solution using Custom Labels to define fiscal quarter start dates, so you can handle mid-month, non-standard fiscal calendars without Apex or Flow.

What We’re Solving

Let’s say you want to evaluate this:

“Does CustomDate__c fall within the current fiscal quarter, based on our company’s offset fiscal calendar?”

Your fiscal year might start on April 6 and follow these quarter breakpoints:

  • Q1: April 6 – July 5
  • Q2: July 6 – October 5
  • Q3: October 6 – January 5
  • Q4: January 6 – April 5 (of the following year)

The challenge is that Salesforce formulas:

  • Don’t support Custom Metadata or dynamic fiscal mapping
  • Can’t hardcode dates if you want to keep the solution maintainable and best practice

So instead, we use Custom Labels to store reusable start dates and dynamically calculate fiscal logic using TODAY() and your target field.

🏷️ Step 1: Create Custom Labels for Fiscal Quarter Start Dates

Go to Setup → Custom Labels and create four labels like this:

Label NameValue
Fiscal_Q1_Start__c2023-04-06
Fiscal_Q2_Start__c2023-07-06
Fiscal_Q3_Start__c2023-10-06
Fiscal_Q4_Start__c2023-01-06

These values give us valid input for DATEVALUE() functions — even though we’ll extract only the month and day. To make it obvious the year is ignored to future admins, you could even make the year “1111” or a similarly odd year.

🧩 Step 2: Create the Formula

Create a formula field (return type: Checkbox) with this logic:

IF(
    /* Check if TODAY is in Q1 */
    TODAY() >= DATE(YEAR(TODAY()), MONTH(DATEVALUE($Label.Fiscal_Q1_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q1_Start__c))) &&
    TODAY() <  DATE(YEAR(TODAY()), MONTH(DATEVALUE($Label.Fiscal_Q2_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q2_Start__c))),

    /* If Q1, check if CustomDate__c is also in Q1 */
    CustomDate__c >= DATE(YEAR(CustomDate__c), MONTH(DATEVALUE($Label.Fiscal_Q1_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q1_Start__c))) &&
    CustomDate__c <  DATE(YEAR(CustomDate__c), MONTH(DATEVALUE($Label.Fiscal_Q2_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q2_Start__c))),

    IF(
        /* Check if TODAY is in Q2 */
        TODAY() >= DATE(YEAR(TODAY()), MONTH(DATEVALUE($Label.Fiscal_Q2_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q2_Start__c))) &&
        TODAY() <  DATE(YEAR(TODAY()), MONTH(DATEVALUE($Label.Fiscal_Q3_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q3_Start__c))),

        /* If Q2, check if CustomDate__c is also in Q2 */
        CustomDate__c >= DATE(YEAR(CustomDate__c), MONTH(DATEVALUE($Label.Fiscal_Q2_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q2_Start__c))) &&
        CustomDate__c <  DATE(YEAR(CustomDate__c), MONTH(DATEVALUE($Label.Fiscal_Q3_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q3_Start__c))),

        IF(
            /* Check if TODAY is in Q3 */
            TODAY() >= DATE(YEAR(TODAY()), MONTH(DATEVALUE($Label.Fiscal_Q3_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q3_Start__c))) &&
            TODAY() <  DATE(YEAR(TODAY()) + 1, MONTH(DATEVALUE($Label.Fiscal_Q4_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q4_Start__c))),

            /* If Q3, check if CustomDate__c is also in Q3 */
            CustomDate__c >= DATE(YEAR(CustomDate__c), MONTH(DATEVALUE($Label.Fiscal_Q3_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q3_Start__c))) &&
            CustomDate__c <  DATE(YEAR(CustomDate__c) + 1, MONTH(DATEVALUE($Label.Fiscal_Q4_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q4_Start__c))),

            /* ELSE: assume TODAY is in Q4 — check if CustomDate__c is also in Q4 */
            CustomDate__c >= DATE(YEAR(CustomDate__c) + 1, MONTH(DATEVALUE($Label.Fiscal_Q4_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q4_Start__c))) &&
            CustomDate__c <  DATE(YEAR(CustomDate__c) + 1, MONTH(DATEVALUE($Label.Fiscal_Q1_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q1_Start__c)))
        )
    )
)

What This Formula Does

  • Dynamically identifies which quarter TODAY() falls into by comparing it to the quarter start dates (using only the month/day from Custom Labels)
  • Then checks if CustomDate__c falls within the same start/end range
  • Returns TRUE if both dates are in the same fiscal quarter, which means that the date field is in the current quarter

Why This Works So Well

✅ No hardcoded dates

✅ No Apex or Flow required

✅ Works even if your fiscal quarters start mid-month

✅ Easily maintainable: just update the label values if your fiscal calendar shifts

⚠️ When This Does Not Work

This approach assumes that:

  • Your fiscal quarter breakpoints are the same every year

If your calendar shifts annually (such as the fiscal year starting on “second Sunday in February”, which will be a different day of month every year), you’ll need to instead store quarter start dates in a Custom Metadata and include the fiscal year for each, then use Flow or Apex to match each date to a dynamic record including the year reference. This makes the solution quite a bit more complex but is critical for companies with wandering fiscal year starts.

Returning Quarter or Year-Quarter Values from any Date Field

In addition to checking whether a date falls in the current fiscal quarter, you can also use this same formula+custom label framework to simply return the fiscal quarter or a sortable year-quarter string like “20242” based on any date field in your org.

This is useful for:

  • Grouping records by fiscal quarter
  • Filtering reports or dashboards
  • Creating lightweight fiscal keys for integrations (such as calculating the quarter of a deal in Salesforce, but passing the quarter value downstream into Netsuite or other finance system)

Return Just the Fiscal Quarter (e.g. “Q1”)

This formula compares the month and day of your input date (MyDate__c) to the start dates of each fiscal quarter, which are stored in Custom Labels. It returns the matching quarter based on where the date falls.

CASE(
  TRUE,
  /* Q1: Between Q1 and Q2 start */
  MyDate__c >= DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q1_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q1_Start__c))) &&
  MyDate__c <  DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q2_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q2_Start__c))),
  "Q1",

  /* Q2: Between Q2 and Q3 start */
  MyDate__c >= DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q2_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q2_Start__c))) &&
  MyDate__c <  DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q3_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q3_Start__c))),
  "Q2",

  /* Q3: Between Q3 and Q4 start */
  MyDate__c >= DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q3_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q3_Start__c))) &&
  MyDate__c <  DATE(YEAR(MyDate__c) + 1, MONTH(DATEVALUE($Label.Fiscal_Q4_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q4_Start__c))),
  "Q3",

  /* Else: assume Q4 */
  "Q4"
)

Return Sortable Year-Quarter (e.g., “20242”)

This formula takes the calendar year of MyDate__c and appends the numerical quarter (1–4) determined using the same quarter start logic. The result is a compact, sortable string that’s ideal for grouping, filtering, or integration keys.

TEXT(YEAR(MyDate__c)) &
CASE(
  TRUE,
  MyDate__c >= DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q1_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q1_Start__c))) &&
  MyDate__c <  DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q2_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q2_Start__c))),
  "1",

  MyDate__c >= DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q2_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q2_Start__c))) &&
  MyDate__c <  DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q3_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q3_Start__c))),
  "2",

  MyDate__c >= DATE(YEAR(MyDate__c), MONTH(DATEVALUE($Label.Fiscal_Q3_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q3_Start__c))) &&
  MyDate__c <  DATE(YEAR(MyDate__c) + 1, MONTH(DATEVALUE($Label.Fiscal_Q4_Start__c)), DAY(DATEVALUE($Label.Fiscal_Q4_Start__c))),
  "3",
  "4"
)

These formulas make it easy to group and filter records by fiscal quarter, even if your organization uses non-standard or mid-month fiscal start dates. As long as the quarter boundaries are the same each year, this is a scalable and declarative solution — no Apex, no Custom Metadata, just smart use of Custom Labels.

Conclusion

This formula-based approach using Custom Labels allows you to dynamically evaluate whether a date falls in the current fiscal quarter even with a mid-month or offset fiscal year. You can use the same framework to return just the quarter value or a year-quarter value based on a nonstandard fiscal breakdown as well. It’s fast, declarative, and scalable for pretty much any use case, except for companies with fiscal dates that change every year which requires a more robust Custom Metadata + Flow or Apex solution. I don’t have an article on that, but let me know if you want me to write one up!