Formulas

B

bwest

I want to create a worksheet that automatically inserts roundtrip mileage for a specific location when the location code is entered. There are approximately 20 location codes. Theoretically, it should be an IF...Then function but it looks as if each formula is limited to 7 conditions. Any help?
 
F

Frank Kabel

Hi
use VLOOKUP for this. See:
http://www.mvps.org/dmcritchie/excel/vlookup.htm

--
Regards
Frank Kabel
Frankfurt, Germany

bwest said:
I want to create a worksheet that automatically inserts roundtrip
mileage for a specific location when the location code is entered.
There are approximately 20 location codes. Theoretically, it should be
an IF...Then function but it looks as if each formula is limited to 7
conditions. Any help?
 
T

Trevor

You should create a small table with the location codes in the first column
and the corresponding mileages in the second column. Then, use the VLOOKUP
function.

If your location code is in cell C1, and your lookup table is in columns A
and B, you can use the following formula:
=VLOOKUP(C1,A1:B20,2,FALSE)

bwest said:
I want to create a worksheet that automatically inserts roundtrip mileage
for a specific location when the location code is entered. There are
approximately 20 location codes. Theoretically, it should be an IF...Then
function but it looks as if each formula is limited to 7 conditions. Any
help?
 
Top