Access table by column name in a cell, and row number specific ranges

dnaiel

New Member
Joined
Mar 20, 2017
Messages
2
Hi,

I have an excel table named incomeTable like this:

name
spend
income
mario
3
10
roger
4
5
tom
5
4

<tbody>
</tbody>

I'd want to access a given column and a given range of rows (but getting the column name from a specific cell).

I.e., Let us say I have in A2 the column name of interest

columnNameOfIInterest
spend

<tbody>
</tbody>

Then, how would I access a range of rows and all the contents in that column?
=incomeTable[[1:2],[=$A2]]?
(where A2 is spend)

and it'd return
3
4

<tbody>
</tbody>
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi,

If you're looking to SUM those values you could use something like this...

=SUM(INDEX(IncomeTable,1,MATCH(A2,IncomeTable[#Headers],0)):INDEX(IncomeTable,2,MATCH(A2,IncomeTable[#Headers],0)))
 
Upvote 0
Hi Mikey, Thanks. I am not looking to do a sum though, just looking to access a given column and a range of rows. Is that possible using the table format?
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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