Sumif/Sumproduct formula to add all values up until selected month

Edmond_Dantes

New Member
Joined
Nov 25, 2010
Messages
17
Hi guys

Hope someone can help.

I need a formula that will sum all the expenditure related to a particular item up until the end of a month which is selected by the user.

The user will select the month from a dropdown list on a separate worksheet from the data. Say this dropdown lies in B3.

This is what I've got so far:
=SUMIF(Data!M:M,$B15, Data!Y:Y)
=SUMIF(Data!M:M,$B15, Data!Z:Z)
........
=SUMIF(Data!M:M,$B15, Data!AJ:AJ)

Column M in the datasheet contains a list of items, say books, dvds etc.
Column Y in the datasheet contains expenditure for April 2011, Z for May 2011 and so on
The matching item lies in B15, say "books."

I would need a single formula that will calculate all the expenditure for the item "books" up until the end of the month which the user selects.

I hope this is all clear. Any help would be appreciated.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
You could maybe tidy this up a bit (if possible). I would have all the "matching items" in one column (my column A), all the dates in column B, a new column C which would just have the month name (formula is =Text(b1,"MMMM") and pull down), Column D expenditure.

Then have your selection in other cell e.g. Select month in B5 and Select matching item in B6

Then =SUMIFS(D:D,A:A,B6,C:C,B5)
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,687
Members
452,938
Latest member
babeneker

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