Forum menu
Excel - what formul...
 

[Closed] Excel - what formula do I need?

Posts: 3273
Free Member
Topic starter
 
[#8238811]

I have two cells, each of which could contain 1 of 5 options.

I have a table with cell 1 options down the side, cell 2 options across the bottom and filled with every permutation.

What formula do I need to produce a result from the table for instance if cell 1 = H and cell 2 = L the table shows 200 in the corresponding row/column.

Tried VLookup but that seems to apply to lists rather than tables.

Ta!


 
Posted : 21/12/2016 1:32 pm
Posts: 0
Free Member
 

Can you upload a screenshot? I'm confused.


 
Posted : 21/12/2016 1:38 pm
Posts: 303
Free Member
 

Nor sure I fully understand the question but you can use HLOOKUP to get the column nested with VLOOKUP to get the cell.


 
Posted : 21/12/2016 1:39 pm
Posts: 13554
Free Member
 

Do the letters hold a numeric value then? Screenshot would help.


 
Posted : 21/12/2016 1:43 pm
Posts: 14933
Full Member
 

If I'm understanding it correctly

Cell A will contain a row reference for a table
Cell B contains a column reference for a table

He want's a formula that looks at the combination of Cell A & B and finds the corresponding result in the table?


 
Posted : 21/12/2016 1:43 pm
Posts: 3273
Free Member
Topic starter
 

Basically I want a formula which reads from a table of results if I tell it a value on the x axis and y axis

Edit Boardinbob has it


 
Posted : 21/12/2016 1:47 pm
Posts: 13554
Free Member
 

Would an IF scenario not work in that instance (as outlined by BoardinBob)?


 
Posted : 21/12/2016 1:47 pm
Posts: 2053
Free Member
 

think enmac has the solution


 
Posted : 21/12/2016 1:49 pm
Posts: 3273
Free Member
Topic starter
 

Too many variables for IF


 
Posted : 21/12/2016 1:49 pm
Posts: 8890
Full Member
 

You need a match in your lookup

=VLOOKUP(A9, $A$1:$F$6, MATCH(B9, $A$1:$F$1, 0), FALSE)

for example

In my example above

the table is A1:F6 including headings to be looked up
A9 the value to be looked up from column A
B9 the value to be matched to row 1


 
Posted : 21/12/2016 1:57 pm
Posts: 0
Free Member
 

=VLOOKUP(B8,A1:F6,C8+1,FALSE)

Where:
cell b8 is your "cell 1"
cell c8 is your "cell 2"
A1:F6 is your table with 5x5 options and the headings for each column and row which relate to the cell 1 and cell 2 choices.


 
Posted : 21/12/2016 2:04 pm
Posts: 0
Free Member
 

Much easier just to write a custom function and use that


 
Posted : 21/12/2016 2:05 pm
Posts: 3273
Free Member
Topic starter
 

Cheers RB that's smashed it! I was nearly there with INDEX-MATCH too but yours is easier


 
Posted : 21/12/2016 2:09 pm
Posts: 8890
Full Member
 

Tried VLookup but that seems to apply to lists rather than tables.

VLOOKUP is for tables but the third value defines the column in the table. You need the MATCH in the example I gave to define which column you want using your second value


 
Posted : 21/12/2016 2:14 pm
Posts: 0
Full Member
 

Mixing VLOOKUP & INDEX/MATCH makes me uncomfortable ๐Ÿ™‚

Assuming the labels are in column A & row 6, and data in range B1:F5:

=INDEX(B1:F5,MATCH(cell1,A1:A5,0),MATCH(cell2,B6:F6,0))


 
Posted : 21/12/2016 2:22 pm