Excel IF statements?

Soldato
Joined
27 Aug 2005
Posts
3,731
Need some help on if statements if any peeps can advise. I'm trying to write a if statements to show the following

IF cell a1 is

Gbp=gbp
Eur = eur
All other currency = OTH
 
=IF(A1="gbp","gpb",IF(A1="Eur","eur","OTH"))

This isn't case sensitive so should work with any input for GPB(or Gbp etc)
 
IF (a1 = "Gbp", "gbp" , IF(a1 ="Eur", "eur" , "OTH"))

Beaten like a ginger step child!

Blew my mind when I realised you could do nested if statements like this

They really blow your mind when someones gotten over excited with them and you've then got to try and figure out what's going on.
 
Just to be different, and easier to expand in future without creating a nested monster:

=IF(OR(A1="gbp",A1="eur"),LOWER(A1),"OTH")
 
=IF(Ryan-3="Cared to listen",[ANSWER CORRECTLY],[Instead this failure is shown..]

Not to derail, but they've added some useful features to office, but in the process have made their already included features worse or more of a pain to use.
 
Just to be different, and easier to expand in future without creating a nested monster:

=IF(OR(A1="gbp",A1="eur"),LOWER(A1),"OTH")

Slight expansion on that to do a bit of tidying up (which wasn't actually asked for) but if you went with =IF(A1="","",(IF(OR(A1="gbp",A1="eur"),LOWER(A1),"OTH"))) then where nothing is entered in the cell then the formula will return a blank. It looks a bit neater if you're copying the formula down the spreadsheet as otherwise you'll end up with "OTH" all the way down when really there's nothing to be displayed. Makes no functional difference but it might appeal if you're obsessive about keeping it looking clean.
 
Since we're getting down into ultra pedantic detail, the real Excel pros write OR functions like this

Code:
OR(A1={"eur","gbp"})

:cool:
 
Back
Top Bottom