# using multiple if conditions

April 1, 2009 at 21:22:24
Specs: Windows XP
 would like to use if condition in excel. I have to use logical test for 15 names and 4 values i.e, criteria?In one column I have 15 dealer names. I want to use if condition for these 15 names with 4 criteria. if i enter any one dealer name, criteria is trans, if I enter 1 then it is IN, if I enter 0 then it is NA and if I enter any other, it should be sale. please help me

See More: using multiple if conditions

#1
April 2, 2009 at 06:22:32
 Is this what you are looking for?With your list in A1:A15 and yoru data entry in B1, try this formula:=IF(B1=1,"IN",IF(B1=0,"NA",IF(NOT(ISERROR(VLOOKUP(B1,\$A\$1:\$A\$15,1,0))),"trans","sale")))

Report •

#2
April 2, 2009 at 21:42:12
 Hi Thank u for your answer. But I got the result with IF(OR....). Thank you very much once again for your kind response.With regards,Gururaj Rao

Report •

#3
April 3, 2009 at 03:28:57
 Please share your solution.I'm just curious as to how you did it.

Report •

Related Solutions

#4
April 3, 2009 at 04:37:26
 Hi here is the formula which I used.=IF(F2=1,"IN", IF(F2=0,"NA",IF(OR(F2="KUNDAPUR",F2="BARKURI",F2="BELMAN",F2="BENAKA",F2="BHUMEGA",F2="HEBRI",F2="JJ MALPE",F2="N S MOTORS",F2="SALIGRAMA",F2="SHANTHA",F2="SHIRALI",F2="V2 BYNDOOR",F2="UDUPI"),"TRANS","SALES")))Thanxwith regards,Gururaj Rao

Report •

#5
April 3, 2009 at 04:43:44
 IN case you're still monitoring, As the respondee mentioned Vlookup would have been easier.Either way works, however if you wanted to add other entries the VLookup would be quicker/ easier methodJust an FYI for youWhat happened to my quote

Report •

#6
April 3, 2009 at 12:18:36
 Not to mention 226 characters vs 88.While not a huge difference on a one-off basis, I wouldn't want a spreadsheet full of long, hardcoded formulae.There's also a much higher chance of making a typo since you have to duplicate each name in the list by typing it into the formula.With a longer list, you could possibly exceed the character limit allowed in a formula.And last, but certainly not least,IF(NOT(ISERROR(VLOOKUP(B1,\$A\$1:\$A\$15,1,0)))looks so much cooler than IF(OR(text,text,text, etc.) ;-)

Report •