Allow user input to change Table reference in Index, match, match

Stevenb2020

New Member
Joined
Feb 19, 2019
Messages
3
I have the following Index, match, match in my worksheet:

=-INDEX(Table2018PL[[#Headers],[#Data],[GlCode]:[4thQtr]],MATCH('FULL YEAR'!$A8,Table2018PL[[#Headers],[#Data],[GlCode]],0),MATCH('FULL YEAR'!E$5,Table2018PL[[#Headers],[GlCode]:[4thQtr]],0))

I would like to replace Table2018PL with Table2019PL using data from an input cell in another tab. The reference appears 3 times, once for array and twice for lookup array. Essentially what I want to do is make the "2018" variable based on user input.

Is there a way to do this?

Thanks,
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
=-INDEX(INDIRECT("Table" & tab!B2 & "PL[[#Headers],[#Data],[GlCode]:[4thQtr]]"),MATCH('FULL YEAR'!$A8,INDIRECT("Table" tab!B2 & "PL[[#Headers],[#Data],[GlCode]]"),0),MATCH('FULL YEAR'!E$5,INDIRECT("Table" & tab!B2 & "PL[[#Headers],[GlCode]:[4thQtr]]"),0))


Change "tab" and "B2" by the name of your sheet and the cell where you will put the year
 
Upvote 0
I have tried that and it still doesn't work. User input is into cell B10 on tab 'Set-up'. Here is what I am trying:

=-INDEX("Table"&'Set-up'!B10&"PL"[[#Headers],[#Data],[GlCode]:[4thQtr]],MATCH('FULL YEAR'!$A8,"Table"&'Set-up'!B10&"PL"[[#Headers],[#Data],[GlCode]],0),MATCH('FULL YEAR'!E$5,"Table"&'Set-up'!B10&"PL"[[#Headers],[GlCode]:[4thQtr]],0))

"PL"[[#Headers] is highlighted in grey and

The message I get is:

There's a problem with this formula.

Not trying to type a formula?
When the first character is an equal (=) of minus (-) sign, Excel thinks it's a formula:

you type: =1+1, cell shows: 2

To get around this type an apostrophe (') first:

you type: '=1+1, cell shows: =1+1

OK Help
 
Upvote 0
Check the correct position of the "

For example:

My formula

=-INDEX(INDIRECT("Table" & tab!B2 & "PL[[#Headers],[#Data],[GlCode]:[4thQtr]]")

Your formula

=-INDEX("Table"&'Set-up'!B10&"PL"[[#Headers],[#Data],[GlCode]:[4thQtr]]
Try this:

=-INDEX(INDIRECT("Table" & 'Set-up'!B10 & "PL[[#Headers],[#Data],[GlCode]:[4thQtr]]"),MATCH('FULL YEAR'!$A8,INDIRECT("Table" 'Set-up'!B10 & "PL[[#Headers],[#Data],[GlCode]]"),0),MATCH('FULL YEAR'!E$5,INDIRECT("Table" & 'Set-up'!B10 & "PL[[#Headers],[GlCode]:[4thQtr]]"),0))


 
Upvote 0
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,664
Members
448,976
Latest member
sweeberry

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