how to sum multiple columns in a vlookup or index match

bigdan

Well-known Member
Joined
Oct 5, 2009
Messages
840
Office Version
  1. 2013
Platform
  1. Windows
I have an index match formula that I want to modify.


Here's the current formula:
=INDEX($C$7:$E$12,MATCH($A19,$A$7:$A$12,0),2)


So this is looking at a range, C7-E12, and returning the relevant value in the column I specify (the last number in the formula, currently 2).


What I'd LIKE to do, is not just look at value in the current column, but all the columns prior to it. So when I type 2 I'd like it to sum the first columns (in the relevant row). If I type 4 I'd like to see the sum of 4 columns in that row.


Please help!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Try...

=SUM(INDEX($C$7:$E$12,MATCH($A19,$A$7:$A$12,0),1):INDEX($C$7:$E$12,MATCH($A19,$A$7:$A$12,0),B19))

...where B19 contains the number of columns to sum.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,214,959
Messages
6,122,476
Members
449,087
Latest member
RExcelSearch

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