IF Condition

  • Thread starter Thread starter David Kennedy
  • Start date Start date
D

David Kennedy

hi if you could help me with this it would be great,

i have tried to use the nested IF condition to insert
numbers in a column beside a column of country names(there
are 100 names in this column)
i have used the following formula :
=IF(c:c="JAPAN","12",IF(c:c="USA","13",....etc ie if JAPAN
is in the list put 12 in the row of the column next to it
and so on
however i can only do this for up to 8 country names
How do i do this for all the country names

thank you
d kennedy
 
-----Original Message-----
hi if you could help me with this it would be great,

i have tried to use the nested IF condition to insert
numbers in a column beside a column of country names (there
are 100 names in this column)
i have used the following formula :
=IF(c:c="JAPAN","12",IF(c:c="USA","13",....etc ie if JAPAN
is in the list put 12 in the row of the column next to it
and so on
however i can only do this for up to 8 country names
How do i do this for all the country names

thank you
d kennedy
.
You could setup a legend with all the names of the
countries along with their number. Then use the =sumif
(hilight range of countries in legend,hilight country you
want the number for,hilight range of numbers in legend)
 
David,
You would probably be better off using a lookup table.

Set up a table with the county name in the first row and the country number in the second. This does not have to be on the same sheet.

Assuming the lookup value is in cell C1 and the lookup table is on Sheet2 use the formula:

=VLOOKUP(C1,Sheet2!$A$1:$B$3,2,0)

VLOOKUP will return a #N/A error if the lookup value isn't in the table. You can use an IF statement to avoid this:

=IF(ISNA(VLOOKUP(C1,Sheet2!$A$1:$B$3,2,0)),"No Code",VLOOKUP(C1,Sheet2!$A$1:$B$3,2,0))

You will need to adjust the cell references for you application.

Good Luck,
Mark Graesser
(e-mail address removed)

----- David Kennedy wrote: -----

hi if you could help me with this it would be great,

i have tried to use the nested IF condition to insert
numbers in a column beside a column of country names(there
are 100 names in this column)
i have used the following formula :
=IF(c:c="JAPAN","12",IF(c:c="USA","13",....etc ie if JAPAN
is in the list put 12 in the row of the column next to it
and so on
however i can only do this for up to 8 country names
How do i do this for all the country names

thank you
d kennedy
 
Back
Top