Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default if condition doubt

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default if condition doubt

Hi,

I'm not entirely clear what you are trying to do but a table that seems to
describe it might look like this

m 1
e 2
r 3
c 4
h 5
a 6
n 7
t 8
s 9

If thats corect put that table in some place on your worksheet and try this
formula
=VLOOKUP(B4,C1:D9,2,FALSE)

In this case I put the table in C1 to D9

Mike

"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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Doubt Vasu Excel Discussion (Misc queries) 4 January 29th 08 01:39 AM
Macro doubt xavi garriga Excel Discussion (Misc queries) 1 July 30th 07 01:35 PM
I have a doubt! Jaleel Excel Discussion (Misc queries) 4 September 21st 06 01:51 PM
Vlookup doubt.. winson Excel Discussion (Misc queries) 2 January 18th 06 01:28 PM
some doubt mango Excel Worksheet Functions 6 December 31st 04 01:42 PM


All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"