You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Collating data from another tab based on a pop up menu

I'm not quite sure how to phrase this, so I'll just show you what I mean.


I have a document with multiple sheets, each sheet has a table containing category options and their specifications. One sheet in the same document needs to pull the specifications for the various categories, so that various combinations can be assessed.


Here is a screenshot of a category sheet:


The category is LIGHT, and the options are Snake eyes, Piece of flame, etc. The specifications of each option are on the row of the option.


Now, below I have the sheet where I want to be able to compare the combinations. So, I have all the categories listed down column A.



In column B, I've created a drop-down menu with the options for that category (see below)



Now, my question is, how do I populate columns C and beyond, just by choosing an option from the dropdown?


Many thanks!


Randhir


Posted on Apr 9, 2021 5:01 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 13, 2021 1:11 AM

Do all of the tables have the same number of columns with the same headings/data in the same columns? The formula assumes all of the tables are set up exactly the same way. Make sure you don't have any hidden columns or extra columns in any of them. Looking at the results, it appears that half of the table have an extra column to the right of column A. It appears most of these extra columns are empty but some have numbers in them. The column for "vnum" must be column B, "str" must be column C, etc. While there is the possibility the app has a bug causing this problem lets hope the issue is the tables not being the same.


Similar questions

9 replies
Question marked as Top-ranking reply

Apr 13, 2021 1:11 AM in response to randhir128

Do all of the tables have the same number of columns with the same headings/data in the same columns? The formula assumes all of the tables are set up exactly the same way. Make sure you don't have any hidden columns or extra columns in any of them. Looking at the results, it appears that half of the table have an extra column to the right of column A. It appears most of these extra columns are empty but some have numbers in them. The column for "vnum" must be column B, "str" must be column C, etc. While there is the possibility the app has a bug causing this problem lets hope the issue is the tables not being the same.


Apr 9, 2021 8:02 PM in response to randhir128

Did you fill down to the end of the table and only the first row worked?


The IFERROR masks all errors (other than syntax errors) making it hard to tell what it is wrong. You can remove that part of the formula and see what the error is. The two obvious choices are a reference error or a match was not found.


Remove the IFERROR( at the beginning and ,"") at the end. Try that out first in the entire table. You'll have errors in any row with no option chosen but any rows that have an option chosen in column B should give results.


  • Is the table on the Finger 1 sheet named Table 1?
  • Is that table set up like the others: one header row, one header column and goes out to column R?
  • Are there any extraneous spaces in the text "Finger 1", such as a trailing space? The name in the table and the name of the actual sheet must match exactly.
  • Is there an entry in that table for "Troll ring"?
  • Does "troll ring" in the table or in your popup have any extraneous spaces?

Apr 9, 2021 7:31 PM in response to Badunit

Thank you so much Badunit!


It works, but not entirely. I tweaked the row (from 2 to 3) as the 'Eklaviya' sheet has one more header row than the others, and it worked!


=IFERROR(VLOOKUP($B3,INDIRECT($A3&"::Table 1::A:G",addr-style),COLUMN(cell)−1,close-match),"")


However, when I stretched the formula across the row, they got populated till column H, but the sheet goes to S. (My mistake, I didn't show the entire screen earlier.) As below:


I tried changing the G to R.


IFERROR(VLOOKUP($B3,INDIRECT($A3&"::Table 1::A:R",addr-style),COLUMN(cell)−1,close-match),"")


and it worked perfectly. See below:



EXCEPT, when I try the next row, I get nothing. And since I really don't understand what exactly you've done, I don't know what to do!!! You're a genius!


Randhir




Apr 13, 2021 12:34 AM in response to Badunit

Thanks Badunit


I checked, and sure enough, the tables were named incorrectly. I fixed them all, and the sheet got filled out, but there seems to be something weird happening. The first couple of rows are ok, but after that, the values in the cells seem to have shifted over or something. They're getting cross referenced. FYI the data in sheet Finger 1 is exactly the same as Finger 2. Same for Wrist 1 and Wrist 2, and for Neck 1 and Neck 2.


Apr 9, 2021 6:19 PM in response to randhir128

One way would be to use INDIRECT to create a reference to the correct sheet and table then use MATCH to get the correct row and OFFSET to get the data from each cell of that row.


I assume the sheets are named exactly the same as the categories and that all the category tables are Table 1.


Insert two new columns, C and D, into your table

Formula in C2 =A2&"::Table 1"

Formula in D2 =MATCH(B2,INDIRECT(C2&"::A"))

Fill down to complete the columns


Column C creates the string used for making a reference to the table. The result is Sheet_name::Table 1 .

Column D uses INDIRECT to reference column A of that table and uses MATCH to find the row that has the chosen option.


Column E (the 5th column) will be the first column to get data.

E2 =IFERROR(OFFSET(INDIRECT($C3&"::A1"),$D3−1,COLUMN()−4),"")

Fill across to complete the row

Fill down to complete the rest of the rows and columns.


OFFSET(base cell, row offset, column offset)

The base cell is referenced using INDIRECT again. The base is cell A1 of Table 1 of the chosen sheet.

The row offset is the row we determined before, minus 1.

The column offset if the current column minus 4. Column E is 5 so, for column E, the offset will be a 1.


IFERROR is necessary for when you have chosen "none" in your popup.


Hide C&D when it is all set up.

Apr 9, 2021 6:39 PM in response to Badunit

I often keep thinking of the problem after I have posted, especially when it is a complicate set of formulas and I think I can do better. Here is another option.


No new columns are required. The first column to receive data is column C, same as shown in your screenshot.


I used A:G in the formula below because that is all the columns I had in my tables. Change it to correspond with the columns in your "category" tables. Your screenshot showed up to column S but they apparently go farther.


Formula in C2 =IFERROR(VLOOKUP($B2,INDIRECT($A2&"::Table 1::A:G"),COLUMN()−1),"")

Apr 12, 2021 6:53 PM in response to Badunit

Did you fill down to the end of the table and only the first row worked? yes


The IFERROR masks all errors (other than syntax errors) making it hard to tell what it is wrong. You can remove that part of the formula and see what the error is. The two obvious choices are a reference error or a match was not found. Reference error


Are there any extraneous spaces in the text "Finger 1", such as a trailing space? The name in the table and the name of the actual sheet must match exactly. No


Is there an entry in that table for "Troll ring"? yes


Does "troll ring" in the table or in your popup have any extraneous spaces? no



Apr 12, 2021 7:48 PM in response to randhir128

A reference error means one of the cell references in the formula does not exist

B4 definitely exists

A4 definitely exists

The one we are creating that is A4&"::Table 1::A:R" is the obvious problem.


An example would be Finger 1::Table 1::A:R


The Finger 1 sheet exists

Is the table on that sheet named Table 1? That was not shown in your screenshot.

Does it have columns out to R? It appears to in your screenshot.


I suspect it is the table name. It appears the table on sheet "Light" is named Table 1 and the others are not. If you have named the tables the same as the sheets, either change them all back to Table 1 or change them all to be named the same as their sheet. You can use this reference instead (starting in row 3) if they are named exactly the same as the sheets:

A3&"::"&A3&"::A:R"

Collating data from another tab based on a pop up menu

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.