SUMIF w/ sum range being dynamic ROW title

JL_User

New Member
Joined
Oct 11, 2022
Messages
2
Platform
  1. Windows
I have a table of data that's associated with a channel, metric (rows) and months (column).
1665525460855.png


I'm trying to create a view like below where it summarizes the data depending on what time frame the user wants to see. B3, C6 and C9 are hard-coded inputs. Based on those inputs, I'm trying to figure out what the formula is for C14:E16. I think it's some combination of SUMIF and INDEX MATCH, but I haven't been able to figure out how to best structure the formula.

1665525520827.png


Thanks for the help in advance.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
This formula in C14 on the summary view, filled down and right, should hopefully work...
Excel Formula:
=IF($B$3="Monthly",INDEX(Sheet1!$E$3:$P$13,MATCH($C14&D$13,Sheet1!$C$3:$C$20&Sheet1!$D$3:$D$20,0),MATCH($C$6,Sheet1!$E$2:$P$2)),IF($B$3="Quarterly",INDEX(Sheet1!$R$3:$U$13,MATCH($C14&D$13,Sheet1!$C$3:$C$20&Sheet1!$D$3:$D$20,0),MATCH($C$9,Sheet1!$R$2:$U$2))))
Adjust your sheet name and ranges of your full data as needed. This looks at Sheet1 and rows 3:20.
 
Upvote 0
Solution
Welcome to the MrExcel forum!

I haven't been able to test this, since I didn't want to retype everything. (See the XL2BB tool for a better way to present your data.) But this should work for you based on what you showed:

C14:
Excel Formula:
=SUMPRODUCT(Sheet1!$E$3:$U$13*(Sheet1!$C$3:$C$13=$B14)*(Sheet1!$D$3:$D$13=C$13)*(Sheet1!$E$2:$U$2=IF($B$3="MONTHLY",$C$6,$C$9)))

Drag down and across as needed.
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

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