Forum Discussion
How to switch between tables using a dropdown
- Jan 27, 2023
I just noticed your example table in your first post. Was that there the first time you posted it? If so, I didn't see it.
Here it is returned to you in with a formula (and table of tables) that does what you want. There no doubt are other solutions, but take a look at this and see if you can adapt what I've done.
I'd give a more complete explanation if I had time, but I'm needing to leave for a drive shortly. Come back with questions if I can help further.
I'm attaching an example that does the same thing as what you're seeking to do. This is a spreadsheet that changes the table used in a VLOOKUP formula in order to calculate US Federal Income Tax, using different tables based on filing status.
The formula makes use of the relatively new LET function, first, to define the variable ttbl as the result of an INDIRECT VLOOKUP formula that retrieves the name of the table to be used nested in the yet another VLOOKUP that calculates the tax using the appropriate table.
=LET(TTbl,INDIRECT(VLOOKUP(B6,FilingStatus,2,0)),VLOOKUP(A6,TTbl,4,1)+(VLOOKUP(A6,TTbl,6,1)*(A6-(VLOOKUP(A6,TTbl,8,1)))))
If you wish to share your spreadsheet itself (rather than just images) I'd be happy to adapt that formula to your situation. But you're welcome to see if you can reverse engineer the logic of this sample. To share yours, post a copy on OneDrive or in GoogleDrive and paste a link here that grants edit access to that workbook.