Excel Help

Associate
Joined
29 Nov 2007
Posts
306
Location
UK
Column A has different codes in it. I want to output a certain letter in column B depending on what the code in A is (some codes will output the same letter)

Could someone assist? It doesn't seem to like my IF statement.

Thanks
 
depending on how many codes you have, either use nested if statements or a lookup table (use excel help to look for vlookup or hlookup)
 
For some reason it now does like my IF statement (don't know what i've done differently)

Problem is I want to say IF cell1 = "code" then output "A" else do nothing (fine).

But then I want to go on to say IF cell1 = "code2" then output "B" else do notning. Trouble is the "do nothing command of line 1 is conflicting with the "output B" command of line 2.
 
The formula you want should look something like this.

=IF($A$1:$A$10="code","a",IF($A$1:$A$10="code2","b",""))

hovever if you have a lot of different codes you woyuld be best to have these in a table and use a vlookup.
 
Last edited:
You can nest if statements, I'd post a proper explanation but I'm using my iPhone. Google nested if excel statements and you'll find examples to do what you want. It gets messy if you have a lot of options which is where a lookup table is better.
 
how many possible conditions are there?, if statements are fine but the more nesting the easier it is to get it wrong, how about a VLOOKUP?
 
Solved it - I tried a nested if statement but it will only allow 8 IF's. Solved it by creating a table and using VLOOKUP.

Thanks for all your help.
 
Back
Top Bottom