Referencing a column in a table based on a variable

simonj64

Board Regular
Joined
Apr 1, 2006
Messages
86
Hi,

Apologies for raising this, but really struggling to get this working.

I have a table, one column in the table will reference one of 15 other columns in the table based on a selection made by a user - I cannot get this to work with INDIRECT and most of the comments I have read indicate as it is a volatile function, do not use it anyhow.

So I have 15 period columns in a table (myTable) as follows Prd1, Prd2........Prd15
I have a named range elsewhere in the workbook, where a user selects a value between 1-15, called nPeriod.
Back to the table, I have a column which needs to reference one of the 15 period columns - what formula should be entered into this column to reference one of the 15 based on the user entry.

Thanks for any assistance.

Simon
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi Simon

Not clear if you want to reference just the data or to include the headers. Anyway, you can use Index() and a structured reference for the table.

For ex., for the data part, use:

INDEX(MyTable,0,nPeriod)
 
Upvote 0

Forum statistics

Threads
1,223,645
Messages
6,173,529
Members
452,520
Latest member
Pingaware

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