Numbers LOOKUP Issue?

This is pertaining to Numbers version 6.1 (6369), the latest version supporting High Sierra.


I created a table for each year of interest. Column A of each table contains the date. I wish to search the DATE column (A) for a specified date and retrieve the corresponding value from one of the other columns. For testing I create simple tables. 

The goal is to find the date shown in Table 1::A2 in the appropriate YEAR table, and return the corresponding value in column B (this is a simplified example, not the real data). Table 1 row 3 is the complete and successful function. Row 4 verifies the YEAR function will return the year of A1. This is used to determine the Table to search. Row 5 verifies concatenation of the YEAR function and column from which to retrieve the return data. Row 6 is the attempt to create the function call using 'variables'. Column B contains the red triangle containing a Bang (!). The error message is "The formula contains an invalid reference." This appears to be referring to YEAR(A$2)&"::A:Day Of Week".


Simple now, right? Simply create the VLOOKUP( what to search for, where to search, where to find return value). Problem is it doesn't work. VLOOKUP fails to concatenate the YEAR and column (Year(A$2)&::A:Day Of Week) into an accepted reference.


I can only think to create my own version of VLOOKUP. Any other suggestions? Same issue with HLOOKUP and LOOKUP.


MacBook Air 13″, macOS 10.13

Posted on Nov 22, 2020 2:01 PM

Reply

Similar questions

9 replies

Nov 22, 2020 5:04 PM in response to Paul Stalk

You created a string to describe the range you wanted but did not take the next required step of turing that string into a cell/range reference. You need the INDIRECT function in there.


Formula in Table 1 cell B6 should be

=VLOOKUP(A2,INDIRECT(YEAR(A2)&"::A:Day of Week"),2,1)


A more robust function would not use the header name for column B, it would refer to that column as "B"

=VLOOKUP(A2,INDIRECT(YEAR(A2)&"::A:B"),2,1)


And are you sure you want to use "close match" vs "exact match" in your VLOOKUP function? It is hard to tell what it might think is "close" if it does not find the exact thing you are looking for.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Numbers LOOKUP Issue?

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