View Full Version : how to do nested ifs?...

2016-04-13, 03:41 PM
so..I can create a column "if [alpha]="A" then "Hi" else "Bye"" but

what if I want to do a nested ifs like if([alpha]="A","Hi",if([alpha]="B","Hello","Bye"))

thank you

Ken Puls
2016-04-13, 03:43 PM
Similar concept, although I sometimes find it helps to wrap the nested if in parenthesis:

if [alpha]="A" then "Hi" else (if [alpha]="B" then "Hello" else "Bye")

2016-04-13, 05:54 PM
thank you sir!

You should come up with a PQ formula book...we need PQ formulas that can relate to Excel formulas...

Ken Puls
2016-04-13, 06:42 PM
Well... M is for Data Monkey (http://www.excelguru.ca/monkey) already covers the following conversions:

LEFT, RIGHT, MID, LEN, FIND (Chapter 17)
IF, IFERROR (Chapter 18)
VLOOKUP, SWITCH (Chapter 22)
A wide variety of date function equivalents (Chapter 24)

So I guess the question I'd have to ask is... which are missing? Which ones do you feel need coverage?