sumproduct values in multiple columns?

wardrevcu

New Member
Joined
Dec 20, 2014
Messages
2
I have spending data that are entered daily into one table under the column headings:
Date, Item, Cash_amt, Cap1_amt, Visa_amt

There are duplicate dates, duplicate "item" names, and the $ values for any given item can fall into 3 different columns but on different rows. See the picture link. (excelquestion01)

I need to sum all $ values for a certain item for a certain date range. The final sum will go into a different table on a different worksheet.

I tried using SUMPRODUCT, but its only returning the $ value for the "first" item name it finds in the column. Here's my formula:

=IF((OR(Daily_Spending2014[Date]>=$M$2,Daily_Spending2014[Date]<=$N$2)),SUMPRODUCT(VLOOKUP(L5,Daily_Spending2014!$D$4:$G$13,{2,3,4},0)),"")

I also tried the following formula but it didn't work either:

=SUMPRODUCT((Daily_Spending2014[Date]>=$M$2)*(Daily_Spending2014[Date]<=$N$2)*(Daily_Spending2014[Item]=$L$5)*(Daily_Spending2014[Cash_amt])*(Daily_Spending2014[CAP1_amt])*(Daily_Spending2014[VISA_amt]))

I can send you an Excel file if you need it.

Thanks!
 
Try this format:
Code:
=SUMPRODUCT(--(Daily_Spending2014[Date]>=$M$2),--(Daily_Spending2014[Date]<=$N$2),--(Daily_Spending2014[Item]=$L$5),Daily_Spending2014[Cash_amt]+Daily_Spending2014[CAP1_amt]+Daily_Spending2014[VISA_amt])
 
Upvote 0
Try this format:
Code:
=SUMPRODUCT(--(Daily_Spending2014[Date]>=$M$2),--(Daily_Spending2014[Date]<=$N$2),--(Daily_Spending2014[Item]=$L$5),Daily_Spending2014[Cash_amt]+Daily_Spending2014[CAP1_amt]+Daily_Spending2014[VISA_amt])

Plus signs...geez! I never thought of that...go figure. That worked perfectly, thanks a lot!
 
Upvote 0
Welcome to the MrExcel board!

Since the columns to sum are adjacent, you could also use this slightly more compact form.
Code:
=SUMPRODUCT((Daily_Spending2014[Date]>=$M$2)*(Daily_Spending2014[Date]<=$N$2)*(Daily_Spending2014[Item]=$L$5)*Daily_Spending2014[[Cash_amt]:[VISA_amt]])
 
Upvote 0

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