SUMIFS and Dates not working

NicholasP

Active Member
Joined
Nov 18, 2006
Messages
291
I think I'm pretty close to getting this to work, but I'm clearly missing something (probably something easy too). My formula is trying to sum the data in column AH between the dates in column A. However, it just keeps returning 0.....So here's my formula:

=SUMIFS('TEST'!AH:AH,'TEST'!A:A,TEXT(A3,"m/dd/yyyy"),'TEST'!A:A,TEXT(A4,"m/dd/yyyy"))

Each of the dates are numbers, I checked using ISNUMBER

Any help would be greatly appreciated!!!

Thanks
Nick
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
What is the format of the dates in column A?
Are they dates (numbers) or text?

Also, the way you have written it, you are not checking for between, but rather the dates must be equal to both A3 and A4 simultaneously.
 
Last edited:
Upvote 0
=SUMIFS('TEST'!AH:AH,'TEST'!A:A,">="&A4,'TEST'!A:A,"<="&A3)

this did it....not sure why I have have the >= and <= signs tho...What do you mean "the way I have it written, the dates must be equal to both A3 and A4 simultaneously." ?? Just curious as to why my approach was wrong (so hopefully I don't ask the same question twice) :D

Thanks
Nick
 
Upvote 0
You want to only sum values whose dates fall in between A4 and A3, right?
So, another way of checking to see if a "date" is between the dates in A4 and A3 is like this:
Code:
[B]A4 <= Date <= A3[/B]
And the format of the SUMIFS function is:
=SUMIFS(range to sum,criteria range 1, criteria 1, criteria range 2, criteria 2,...)

So, what if we had a few criteria, one of which is we wanted to only sum records if the name column was "Bob", it might looks something like this:
=SUMIFS(Z1:Z100,A1:A100,"Bob",...)
Note that by using that criteria without an operand like equals, greater than, less than, etc, it is assumed to be equals.
So the formula above would only sum records where column A is equal to "Bob" (not "less than" Bob, or "greater than" Bob).

The way you wrote your formula, without any operands, it is assuming you mean equal.
So your original criteria was checking for the following:
-1st Criteria: date in column A equal to A3
-2nd Criteria: date in column A equal to A4

Since ALL criteria must be met, that means it would only sum records where your date in column and A3 and A4 are all the same.
If your dates in A3 and A4 are not the same, that will never happen, so you will always get zero.
(You also had the issue of using the Text function, which returns Text, and comparing Text to Dates/Numbers does not work, but I see your figured that out with your second formula).
So, you need to use the greater than/less than formulas to get your date within a date range.

If you take a few moments to read through the explanation in the link provided that you used to come up with your formula, that should help explain (or at least compliment) what I said here.

Does that make sense now?
 
Last edited:
Upvote 0
Hey Joe -- thanks a lot, that does make sense. Your explanation made more sense to me than the link you sent.

Thanks again
Nick
 
Upvote 0
Your welcome! Glad to help!:)
 
Upvote 0
Your welcome! Glad to help!:)



I have been working with same forumla but it is not working. i don't understand why it is not picking up the dates that are a result of a formula. when i put numerical value in dates it starts working.

Formulas are as follows:

B3=MAX(Production!$A:$A)

O2 =IF(MONTH($B$3-WEEKDAY($B$3,11)+1)=MONTH($B$3),$B$3-WEEKDAY($B$3,11)+1,DATE(YEAR($B$3),MONTH($B$3),1))

N2 =B3

=SUMIFS(Production!B:B,Production!$A:$A,"<=" & Report!$O$2,Production!$A:$A,">=" & Report!$N$2)


Please help as it is not working
 
Upvote 0

Forum statistics

Threads
1,214,959
Messages
6,122,476
Members
449,087
Latest member
RExcelSearch

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top