View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Vito
 
Posts: n/a
Default IF AND Function problems


Possibly you can create a table on the side showing the possible
combinations in one column and the desired respective result in another
and use a vlookup to retrieve the desired result.

E.g.

Table in J1:K12
Code Result
A1 A
A2 B
A3 C
A4 D
B1 E
B2 F
B3 G
B4 H
C1 I
C2 J
C3 K


If I have these following entries, where A, B, C are the actual column
headers and the 1, 2, 3 are entries made by the user.

A B C
1 2 3


Then a formula to use can be:
=VLOOKUP(LEFT(ADDRESS(1,COLUMN(A1),4),1)&A1,$J$1:$ K$12,2,0)
copied across the columns.

Note: This formula assumes you start entering the data in A1. Change
the cell ref in the Column() function and in the ref after the & symbol
to match the column you enter data in. Also adjust lookup range to
suit.

This formula takes the letter of the column address and combines it
with the number you type into the cell in the same column and then it
looks up this combo in your table and retrieves the corresponding
result.

For the example above, the formula would return

A F K


Hope this helps.


--
Vito
------------------------------------------------------------------------
Vito's Profile: http://www.excelforum.com/member.php...o&userid=29182
View this thread: http://www.excelforum.com/showthread...hreadid=502105