lookup a value and sum a corresponding dynamic range

doug firr

Board Regular
Joined
Mar 28, 2011
Messages
140
Trying to create a nested formula and am struggling. What I need to do is find a value in a range and then sum the corresponding row. The row grows each month.
This is the data table that needs to be looked up
julyaugustseptemberoctobernovember
tim123456789101212
david987654321123456
john123456789987765
peter432123456789101

<tbody>
</tbody>

I need a formula that looks up a given name and then sums the total for that row. The row grows each month and I'd like to have this automatically update when the new date column is added.

Any pointers?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Assuming names in A2:A5 and data in B2:Z5 try this formula to sum data for "john" (assuming that will be only 1 row)

=SUM(INDEX(B2:Z5,MATCH("john",A2:B5,0),0))

That will sum data up to column Z, you could extend that further if required. Lookup value "john" could be a cell reference if required
 
Upvote 0
Hi,
let Your Data be in Columns A:F, exactly in A1:F5. If in H2 is a given name, in I2 the following formula is enough:
Code:
=SUM(INDIRECT(ADDRESS(MATCH(H2,A1:A5,0),2)&":"&ADDRESS(MATCH(H2,A1:A5,0),6)))
Best regards.
 
Upvote 0

Forum statistics

Threads
1,203,434
Messages
6,055,346
Members
444,781
Latest member
rishivar

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