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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
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,213,507
Messages
6,114,029
Members
448,543
Latest member
MartinLarkin

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