I have several tables in one tab which I have named individually. In another tab I have a table that I wish to populate with the same information of the selected table based on a drop down selection. All tables are the same size. The dropdown is also a named range.
The list in the dropdown is the name of each table.
The following is my approach but I’m off by a row. ‘PRCoverage’ is the name of the dropdown.
=INDEX(INDIRECT(PRCoverage),ROW()-ROW($B$7),COLUMN()-COLUMN($B$7))
The issue is that the tables don’t all start in the same row. I’m trying to figure out to way to reference the first row in each table.
To begin with, I’ve put everything onto one sheet for screenshots, this will work across multiple pages.
- I began by having a list I could use for a drop down list in cell
F1
. This is the named range inD2:D3
calledTableList
. Once I had this name, that is how cellF1
validates. - Next, you will see in the formula in
F1
that I have two named ranges. These are dynamic named ranges. To create them: Select cellF1
, then CTRL+F3 to open the name manager. Then select the “New” button. For this demonstration I named itMale_Characters
. For the formula I used:=Sheet1!A3
Please note I am not using absolute references (no “$”). Repeat this for the starting corner of every table you want to display. - Finally, create a nested if statement that works through each table as you can see in my screen shot.
=IF($F$1=$A$1,Male_Characters,IF($F$1=$A$12,Female_Characters,""))
is the same code in all the cells of my display table.
Sample Spreadsheet: Click Here
Answer:
We can get the in which entries of particular start with something like the following:
=ROW(INDIRECT(MyDropDown))
I then use OFFSET
to fill my TABLE
=OFFSET(INDIRECT("Sheet2!A" & ROW(INDIRECT(MyDropDown))),ROW()-2,COLUMN()-1)
But you can just as easily swap OFFSET
for INDEX
=INDEX(INDIRECT("Sheet2!A" & ROW(INDIRECT(MyDropDown))),ROW()-2,COLUMN()-1)
Tags: excelexcel, list, pdo, sed, select