LOOKUP (+VLOOKUP & +HLOOKUP) not able to search/return value from entire table?

I have a table of all unique numbers 5 rows by 5 columns.

C1C2C3C4C5

R1

12345
R2678910
R31112131415
R41617181920
R52122232425


This is what I want:

NumberRow NameColumn Name

1

R1

C1

2R1C2
3R1C3
4R1C4

etc.


LOOKUP does not work. VLOOKUP or HLOOKUP does not work.

In B2, I used =LOOKUP($A2, Table 1::$2:$6, $A)

In B3 I used =LOOKUP($A2, Table 1::$B:$F, $1)


This does not work. I get an entire table of the same values. My guess is that LOOKUP is not meant handle an entire table?


I tried:

-Just using the number cells as a range, as well as the entire table.

-HLOOKUP and VLOOKUP, both including and excluding the header row/column.

-MATCH, INDEX, etc, but none worked with an entire table.

-Assigning each row and column a unique number (like 100, 200, etc. for rows and 1000, 2000, etc. for columns) "[V/H]LOOKUP couldn't find the requested value"


-They are all numbers, not strings.


I have no idea what to do. In the time I've been trying to figure it out, I could have just brute forced a table by typing in the values....


Any help appreciated!

MacBook Air, OS X Mavericks (10.9.5), Numbers 3.2.2

Posted on Sep 29, 2014 7:14 AM

Reply
2 replies

Sep 29, 2014 8:27 AM in response to Wesley Johnson

Hi Wesley,


I have a coulple of questions.

What are you trying to accomplish? What are you going to use the information for? This is the big one. There may be an approach that sidesteps your difficulties.

There may be a way to get LOOKUP() to work but it will settle for a close match if it can't find your value. So the question is this, is every value that you are looking for represented in the table? In your example, LOOKUP() would return a value if you looked for 26 or if you were missing a number in a sequence it would return a close match. This may not be good.

Is your data table likely to grow? Or is 5x5 it?

You want the Row and Column names in separate columns. Why?


quinn

Sep 29, 2014 2:10 PM in response to Wesley Johnson

Hi Wesley,


Here is a possible solution.

User uploaded file

The formula in column return and row return simply copies the header. i.e. G2 =A2.


Here is an overview. We will search the columns to discover what row and search rows to discover what column.

User uploaded file

Search columns.

B2 =IFERROR(VLOOKUP($A2,Data Table::B$2:$G$7,8−COLUMN(),FALSE),"")

This is filled across to F2 and then filled down.

You can hide columns B-F.

G2 =CONCATENATE(B2,C2,D2,E2,F2)

This is filled down.

So that was easy.


Searching the rows.

H2 =IFERROR(HLOOKUP($A2,Data Table::B$2:$F$7,6,FALSE),"")

User uploaded file

We need to tweak this formula for each column.

I2 =IFERROR(HLOOKUP($A2,Data Table::$A$3:$F$7,5,FALSE),"")

User uploaded file

There are 2 places the formula changes. The rows-range and the return-row. As the range shrinks, the return row does too.

Once you have the formula adjusted for all of row 2 you can fill down.

M2 can be copied and pasted from G2 and filled down.

M2 =CONCATENATE(H2,I2,J2,K2,L2)

You can hide rows H-L.

You are done.

User uploaded file

Sure hope the screenshots show.😁

let me know if you have any questions.


quinn

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.

LOOKUP (+VLOOKUP & +HLOOKUP) not able to search/return value from entire table?

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