Excel sum formula help needed

mbb4331

Board Regular
Joined
Dec 22, 2005
Messages
152
I have a sum formula to sum all cells in row C where Row A = "Total Revenue" and Row B (date field) is before "10/1/2005".

Currently, the formula ignores the date argument and sums all rows where Column A = "Total Revenue".

Does anyone have any ideas?

{=SUM(IF(TRIM(A2:A15)="Total Revenue", IF(B2:B15<"10/1/2005", C2:C15)))}

Thanks!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I just tried it and your formula seemed to work on the date portion.

Maybe you can eliminate the first part of the formula for a moment and make sure that section is working for you. And then expand back out.

I can throw out some wild guesses why the comparison would work when I tried it and doesn't work for you, but that's all they'd be. (Maybe formats that keep dates from being read as dates, etc.)

Not sure how helpful that is. But your formula itself doesn't look wrong to me.
 
Upvote 0
Try adding this formula to cell D2:

=IF(OR(--YEAR(B2)<2005,AND(--YEAR(2)=2005,--MONTH(B2)<10)),1,0)

Copy and past down the formula

Then add this to get your answer:


=SUMPRODUCT(--(A2:A15="Total Revenue"),--(D2:D15=1),--(C2:C15))
 
Upvote 0
This seems to work for me:

Code:
=SUMPRODUCT(--(TRIM($A$2:$A$15)="Total Revenue"),--($B$2:$B$15<DATE(2005,10,1)),$C$2:$C$15)
 
Upvote 0
It looks like the issue was 'B2:B15<"10/1/2005"'.

'DATE(2005, 10, 1)'
did the trick."

Thanks all!
 
Upvote 0
They make all values that can be numbers act like numbers, even if they are entered as text - ie entered as '5 instead of just 5
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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