Summing a dynamic range with index match

lessh2o

New Member
Joined
Mar 10, 2017
Messages
6
I am stumped, sorry to add yet another question to the compendium of knowledge already here on using index,match and sum together.

The goal is to say return the sum of XX number of months in the row matching "Income" and beginning with "Mar 17" within 'Sheet 2'.

I figured I should use a SUM(INDEX(MATCH(),MATCH())) formula with the second match identifying an array of cells.

Right now, I have something along the lines of:
=SUM(INDEX('Sheet 2'!$F$1:$AG$78,MATCH($R9,'Sheet 2'!$F$1:$F$78,0),MATCH(??))

$R9 is the lookup_value for the row

Any help would be greatly appreciated!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
ABCDEFGHIJK
1Jan 16Feb 16Mar 16Apr 16May 16Jun 16Jul 16Aug 16Sep 16Oct 16
2Income##########
3Expense##########
4Net Income##########

<tbody>
</tbody>

This might help, I'd like to sum the values in red.

Want to match a row lookup_value for "Expense" and a col lookup_value that is "Mar 16" along with another reference cell giving the number of additional columns desired past the identified col lookup_value, in this case "3".
 
Upvote 0
Try...

A1:P4

16-Jan16-Feb16-Mar16-Apr16-May16-Jun16-Jul16-Aug16-Sep16-Oct
Income##########Expense16-Mar30
Expense##########
Net Income##########

<tbody>
</tbody>


P2:

=SUM(INDEX($B$2:$K$4,MATCH(M2,$A$2:$A$4,0),MATCH(N2,$B$1:$K$1,0)):INDEX($B$2:$K$4,MATCH(M2,$A$2:$A$4,0),MATCH(N2,$B$1:$K$1,0)+O2))

Hope this helps!
 
Upvote 0
You're awesome, thank you Domenic.

I knew it was right in front of me, just couldn't think to do a sum(index():index(same col+fixed amount)) function!
 
Upvote 0
This is really great Domenic!
I am curious if you know the formula one would use for conditional formatting of the range that is addressed by this great formula?
I would like to highlight the range based upon the selection.
Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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