SUM IF ??

glerwell

Well-known Member
Joined
Jun 25, 2006
Messages
1,082
Hi

I want to sum all amounts of money in a column for just today and yesterday. I don't want to create a pivot table, so I was wondering whether there is another way around this.

Could the SUMIF and VTODAY functions be combined to create a formula?

The dates are in column B and the amounts in column R.

Thanks
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
insert below formula into cell S1 and copy it at the end of your range;

=IF(OR(B1=TODAY();B1=TODAY()-1);R1;0)

for the result, insert below formula into cell T1;

= sum("S1:S65536")
 
Upvote 0
i can't enter the following formula, and error message comes up saying "the formula you typed contains an error"

=IF(OR(B1=TODAY();B1=TODAY()-1);R1;0)
 
Upvote 0
For one all encompassing formula that you enter only in to one cell:

=SUMIF(B:B,">="&TODAY()-1,R:R)
 
Upvote 0
if the column B contains the date after today, your result would be wrong... if you develop your formula contains that condition, i think the result would be fine..
 
Upvote 0
I assumed his data only included up to today.

In that case:

Code:
=SUMPRODUCT(--(B1:B10>=TODAY()-1),--(B1:B10<TODAY()+1),R1:R10)

Or, for a dynamic range approach:

Code:
=SUMPRODUCT(--(B2:INDEX(B:B,MATCH(9.99999999999999E+307,B:B))>=TODAY()-1),--(B2:INDEX(B:B,MATCH(9.99999999999999E+307,B:B))<TODAY()+1),R2:INDEX(R:R,MATCH(9.99999999999999E+307,B:B)))
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,666
Members
449,091
Latest member
peppernaut

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