totals for specific dates formula

Megan F 40 Reputation points
2026-10-01T14:14:24.41+00:00

Hello!

I have been trying to figure out a way to pull specific dates for the month into a totals column but have not been able to figure out a formula that works. I keep getting a #value error. I've tried sumproducts, filter, etc. I want to add the totals from columns H and I together into B34 and down, based on the date ranges from column A34-37 that match the dates in column G. I don't want to have to keep updating the formula as the source data will change monthly. There will be at least two months in column A every month, so the month names in those cells (A32 and A41) will change monthly. Same goes for the years in column G. Right now, one set of data is for September and one for October. Is this formula possible? I have linked an example file below.

https://storage.to/JNr00Jg31

Microsoft 365 and Office | Excel | For business | Windows
0 comments No comments

4 answers

Sort by: Newest
  1. Dana D 100 Reputation points
    2026-10-03T03:21:15.1833333+00:00

    If it were me, I would reconsider the output layout.

    Instead of complex formulas scattered all over, I would have 1 simplier formula.

    General idea would be like this: Again, just my preference.

    User's image

    Was this answer helpful?

    0 comments No comments

  2. Ashish Mathur 102.5K Reputation points Volunteer Moderator
    2026-10-02T02:11:11.0866667+00:00

    Hi,

    In cell B34, enter this formula

    =BYROW(A34:A37,LAMBDA(z,LET(a,1*(REGEXEXTRACT(TEXTSPLIT(z,"-"),"\d+",1)&"/"&A$32&"/2026"),SUM(($G$3:$G$7>=INDEX(a,1,1))($G$3:$G$7<=INDEX(a,1,2))($H$3:$H$7+$I$3:$I$7)))))

    Hope this helps.

    User's image

    Was this answer helpful?

    0 comments No comments

  3. Heimerdinger 630 Reputation points Independent Advisor
    2026-10-01T15:09:27.3266667+00:00

    Hi @Megan F, 

    In the example workbook, the most reliable approach is to store the month headings as real dates and use SUMIFS to total columns H and I within each displayed date range. 

    1. Make the month headings real dates  Instead of entering September as text in A32, enter:  9/1/2026  User's image Then format A32 with the custom number format: mmmm User's image Do the same in A41 using 10/1/2026. The cells will still display September and October, but Excel will retain the month and year. This also avoids potential #VALUE! errors caused by dates stored as text.   User's imageUser's image
    2. Formula for September 

    Enter this in B34, then fill it down through B37: 

    =SUMIFS($H$3:$H$1000,$G$3:$G$1000,">="&EOMONTH($A$32,-1)+CHOOSE(ROWS($B$34:B34),1,8,15,22),$G$3:$G$1000,"<"&IF(ROWS($B$34:B34)=4,EOMONTH($A$32,0)+1,EOMONTH($A$32,-1)+CHOOSE(ROWS($B$34:B34),8,15,22,29)))+SUMIFS($I$3:$I$1000,$G$3:$G$1000,">="&EOMONTH($A$32,-1)+CHOOSE(ROWS($B$34:B34),1,8,15,22),$G$3:$G$1000,"<"&IF(ROWS($B$34:B34)=4,EOMONTH($A$32,0)+1,EOMONTH($A$32,-1)+CHOOSE(ROWS($B$34:B34),8,15,22,29))) 
     
    
    1. Formula for October 

    Enter this in B43, then fill it down through B46: 

    =SUMIFS($H$3:$H$1000,$G$3:$G$1000,">="&EOMONTH($A$41,-1)+CHOOSE(ROWS($B$43:B43),1,8,15,22),$G$3:$G$1000,"<"&IF(ROWS($B$43:B43)=4,EOMONTH($A$41,0)+1,EOMONTH($A$41,-1)+CHOOSE(ROWS($B$43:B43),8,15,22,29)))+SUMIFS($I$3:$I$1000,$G$3:$G$1000,">="&EOMONTH($A$41,-1)+CHOOSE(ROWS($B$43:B43),1,8,15,22),$G$3:$G$1000,"<"&IF(ROWS($B$43:B43)=4,EOMONTH($A$41,0)+1,EOMONTH($A$41,-1)+CHOOSE(ROWS($B$43:B43),8,15,22,29))) 
     
    

    The formula automatically calculates: 

    • 1st through 7th 
    • 8th through 14th 
    • 15th through 21st 
    • 22nd through the actual final day of the month 

    Based on the sample data, the September 22nd through month-end result should be-268,119.09, while the October 8th through 14th result should be 1,019,706.86. 

    Make sure the values in column G are genuine Excel dates, not text. Also, all SUMIFS ranges must have matching dimensions, such as rows 3 through 1000 for columns G, H, and I, because inconsistent range sizes can cause #VALUE!.  Thank you again for your time and understanding.  I really appreciate your patience, and I’m here to help. Looking forward to your response.   

    Was this answer helpful?

    0 comments No comments

  4. Barry Schwarz 6,191 Reputation points
    2026-10-01T14:49:46.71+00:00

    The root cause of your problem is that you are summing from row 2 which does not contain valid numerical data. While most of the SUM functions will automatically convert non-numeric values to 0, the + addition operator does not. As a result, the expression H2:H100+I2:I100 evaluates to a 99 element array and the first value in the array is an error value. Error values are not automatically converted to 0. Consequently, the entire expression evaluates to an error.

    The simplest solution is to change the starting row of each array expression to row 3. The following formula produced the intended results.

    =SUMPRODUCT((H$3:H$100 + I$3:I$100) * (TEXT(G$3:G$100, "mmmm") = A$32) * (DAY(G$3:G$100) >= 1) * (DAY(G$3:G$100) <= 7))
    

    By adding the $ to the cell references, I was able to copy this formula from B34 down to B37 and change only the starting and ending DAY values for the other three rows. B37 evaluated to -268,119.09 as expected.

    You can also copy these four rows to B43:B46 and change only the TEXT value from A$32 to A$41 in each. B44 evaluates to 1,019,706.86.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.