View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spiky Spiky is offline
external usenet poster
 
Posts: 622
Default if condition doubt

On May 2, 6:03 am, deen wrote:
Hi,

This condition is not working in excel, kindly guide me what is the
way to workin( there is any possible in macro)

=IF(and(B4="m"),1,IF(and(B4="e"),2,IF(and(B4="r"), 3,IF(and(B4="c"),
4,IF(and(B4="h"),5,IF(and(B4="a"),6,IF(AND(B4="n") ,7,IF(and(B4="t"),
8,if(and(b4="s"),9)))))))))

regards,

deen


You can only nest 7 IFs, I think. You have 9 listed there. Definitely
try a VLOOKUP instead.