SUMPRODUCT and INDEX/MATCH?

chuckles1066

Banned
Joined
Dec 20, 2004
Messages
372
Afternoon all, I hope someone can help.

I need to produce some monthly sales stats broken down by week. For week one of the month I've been using something along the lines of

=SUMPRODUCT(--(A1:A9999="WALMART"),--(B1:B9999="NEWSPAPERS"),E1:E9999).

Week two of the month sees the last bit change from E1:E9999 to F1:F9999, week three to G1:G9999 and so on.

What this means is each month I am going to have to hack the formula about to reflect where the current data for each week lives; each new week sees a new column of data.

Is there a way to force Excel to automatically look at the correct column depending on which week/month it is? My limited knowledge tells me INDEX or MATCH will come into it at some point but I haven't got a clue how to code a formula that works.

All advice appreciated.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Row 1 criteria and C1 relevant column to sum such as 5
Data area is named rTbl

=SUMPRODUCT(--(INDEX(rTbl,,1)="Walmart"),--(INDEX(rTbl,,2)="Newspapers"),(INDEX(rTbl,,5))) or
=SUMPRODUCT(--(INDEX(rTbl,,1)=A1),--(INDEX(rTbl,,2)=B1),(INDEX(rTbl,,C1)))
 
Upvote 0

Forum statistics

Threads
1,214,584
Messages
6,120,384
Members
448,956
Latest member
JPav

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