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

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")))

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

Please share your solution. I'm just curious as to how you did it.

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")))

Thanx

with regards,

Gururaj Rao

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 method

Just an FYI for youWhat happened to my quote

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.)

;-)

Ask Your Question

Weekly Poll

Do you think Google Fiber has a strong future?

Discuss in The Lounge

Poll History