Combination

Revenue per month for twelve months in one formula

Total revenue for each of twelve months with one SUMIFS: SEQUENCE counts the months, EDATE turns each count into the first day of a month, and those dates become the criteria.

Functions used:SUMIFSEDATESEQUENCEExcel 2021 or later (This combination needs Excel 2021 or later)

Difficulty rating 4 of 5

Worked example

Revenue per month for the analytical review

Scenario

For the analytical review of Veldhuis Installatie BV you have eight revenue postings on account 8000 from the XAF auditfile for 2025. You want the revenue for each of the twelve months in one column, to compare with the budget and spot months without revenue, without writing twelve SUMIFS formulas.

The data

Sheet excerpt: F2 holds the formula
RowABCDEFG
1DateEntry no.RevenueFirst month1 Jan 2025
215 Jan 202525-0101€12,500.00€ 12.500,00Revenue per month€20,900.00€ 20.900,00=SUMIFS(C2:C9, A2:A9, ">="&EDATE(F1, SEQUENCE(12, 1, 0)), A2:A9, "<"&EDATE(F1, SEQUENCE(12, 1, 1)))=SUMIFS(C2:C9; A2:A9; ">="&EDATE(F1; SEQUENCE(12; 1; 0)); A2:A9; "<"&EDATE(F1; SEQUENCE(12; 1; 1)))
328 Jan 202525-0118€8,400.00€ 8.400,00€15,200.00€ 15.200,00
410 Feb 202525-0204€15,200.00€ 15.200,00€0.00€ 0,00
53 Apr 202525-0407€9,800.00€ 9.800,00€16,100.00€ 16.100,00
630 Apr 202525-0433€6,300.00€ 6.300,00€0.00€ 0,00
721 Jul 202525-0712€21,000.00€ 21.000,00€0.00€ 0,00
814 Nov 202525-1109€17,500.00€ 17.500,00€21,000.00€ 21.000,00
931 Dec 202525-1243€11,400.00€ 11.400,00€0.00€ 0,00
10€0.00€ 0,00
11€0.00€ 0,00
12€17,500.00€ 17.500,00
13€11,400.00€ 11.400,00
14
Formula cell (F2)InputSpilled result

Formula in F2

=SUMIFS(C2:C9, A2:A9, ">="&EDATE(F1, SEQUENCE(12, 1, 0)), A2:A9, "<"&EDATE(F1, SEQUENCE(12, 1, 1)))
=SUMIFS(C2:C9; A2:A9; ">="&EDATE(F1; SEQUENCE(12; 1; 0)); A2:A9; "<"&EDATE(F1; SEQUENCE(12; 1; 1)))

Result: €20,900.00 / €15,200.00 / €0.00 / €16,100.00 / €0.00 / €0.00 / €21,000.00 / €0.00 / €0.00 / €0.00 / €17,500.00 / €11,400.00€ 20.900,00 / € 15.200,00 / € 0,00 / € 16.100,00 / € 0,00 / € 0,00 / € 21.000,00 / € 0,00 / € 0,00 / € 0,00 / € 17.500,00 / € 11.400,00

How the pieces fit together

The formula taken apart, from the inside out. Each part can be typed into its own cell to see what it returns.

  1. =SEQUENCE(12, 1, 0)
    =SEQUENCE(12; 1; 0)

    A column of twelve numbers that starts at 0 and goes up by 1: 0, 1, 2, up to 11. These are the months to move forward from the start date.

  2. =EDATE(F1, SEQUENCE(12, 1, 0))
    =EDATE(F1; SEQUENCE(12; 1; 0))

    EDATE moves the start date in F1 (1 January 2025) forward by each of the twelve numbers. The result is twelve dates: 1 January 2025, 1 February 2025, up to 1 December 2025. These are the first days of the months.

  3. =EDATE(F1, SEQUENCE(12, 1, 1))
    =EDATE(F1; SEQUENCE(12; 1; 1))

    The same, but starting at 1 instead of 0: 1 February 2025 up to 1 January 2026. Each date is the first day of the next month, so it is the end of the month before it, exclusive.

  4. =">="&EDATE(F1, SEQUENCE(12, 1, 0))
    =">="&EDATE(F1; SEQUENCE(12; 1; 0))

    Puts the operator in front of every date, so you get twelve criteria. Excel joins the operator to the date serial number, so the first one is >=45658 (1 January 2025). SUMIFS reads this as: on or after that date.

  5. =SUMIFS(C2:C9, A2:A9, ">="&EDATE(F1, SEQUENCE(12, 1, 0)), A2:A9, "<"&EDATE(F1, SEQUENCE(12, 1, 1)))
    =SUMIFS(C2:C9; A2:A9; ">="&EDATE(F1; SEQUENCE(12; 1; 0)); A2:A9; "<"&EDATE(F1; SEQUENCE(12; 1; 1)))

    SUMIFS runs once per month: it adds the amounts dated on or after the first day of the month and before the first day of the next one. The result is a column of twelve totals, from 20,900 for January to 11,400 for December.

Step by step

  1. SEQUENCE(12, 1, 0) gives 0, 1, 2, up to 11. SEQUENCE(12, 1, 1) gives 1, 2, 3, up to 12.
  2. EDATE(F1, 0 to 11) turns the start date 1 January 2025 into the lower bounds: 1 Jan, 1 Feb, 1 Mar, up to 1 Dec 2025. EDATE(F1, 1 to 12) gives the upper bounds: 1 Feb 2025 up to 1 Jan 2026.
  3. The operators are joined to the dates, so SUMIFS gets twelve pairs of criteria: >=1 Jan and <1 Feb, then >=1 Feb and <1 Mar, and so on.
  4. January: 15 and 28 January qualify, so 12,50012.500 + 8,4008.400 = 20,90020.900. February: only 10 February, so 15,20015.200. March: no postings, so 0.
  5. April: 3 and 30 April, so 9,8009.800 + 6,3006.300 = 16,10016.100. May and June: 0. July: 21,00021.000. August, September and October: 0.
  6. November: 17,50017.500. December: the posting of 31 December is before 1 January 2026, so it counts: 11,40011.400. The twelve totals add up to 102,100102.100, the same as the eight postings: 12,50012.500 + 8,4008.400 + 15,20015.200 + 9,8009.800 + 6,3006.300 + 21,00021.000 + 17,50017.500 + 11,40011.400.

Why it works

SUMIFS accepts an array as criteria and then returns one result per element.

SEQUENCE supplies the month numbers, EDATE converts them to dates and handles different month lengths and the year change by itself, and the lower bound (included) and upper bound (excluded) cut the year into twelve slices without gaps or overlap. Change the start date in F1 and all twelve months follow.

Watch out for

  • The start date must be the first day of a month. If F1 holds 15 January, every slice runs from the 15th to the 15th, and the totals no longer match the calendar months.
  • If the dates in column A are text (common after a CSV import), no posting meets the criteria and all twelve totals show 0 without a warning. Check that A2 is right-aligned or that ISNUMBER(A2) is TRUE, and compare the sum of the twelve months with the total of column C.
  • Postings outside the twelve months are silently left out. Always compare the total of the twelve months with the total of the account, so a posting from 2024 or 2026 does not go unnoticed.

Variations

=SUMIFS(C2:C9, A2:A9, ">="&F1, A2:A9, "<"&EDATE(F1, 1))
=SUMIFS(C2:C9; A2:A9; ">="&F1; A2:A9; "<"&EDATE(F1; 1))

The older approach for one month: the same two criteria without arrays, which you copy down twelve times with a moving start date. Gives 20,90020.900 for January.

=SUMIFS(C2:C9, A2:A9, ">="&F1, A2:A9, "<="&EOMONTH(F1, 0))
=SUMIFS(C2:C9; A2:A9; ">="&F1; A2:A9; "<="&EOMONTH(F1; 0))

The upper bound as the last day of the month with EOMONTH. Gives 20,90020.900 for January too, but it misses postings that carry a time of day after midnight on the last day, so the first-day-of-next-month version is safer.

All combinations