+ Reply to Thread
Results 1 to 5 of 5

Multiple conditions for an IF statement

  1. #1
    Registered User
    Join Date
    02-21-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    66

    Multiple conditions for an IF statement

    Hi there,

    Hopefully a quick and easy one, how would I insert a range or array of criteria for an IF statement (short of using lookups unless that's the only way?)

    Simplifying my formula I have:

    =if(e45={"OCT","NOV","DEC"},"YES","NO"}

    what would the syntax for an array be in an if statement??

    Many thanks in advance,

    Mike

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Multiple conditions for an IF statement

    One way without using array is

    =if(or(e45="Oct",e45="Nov",e45="Dec"),"Yes","No")
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    02-21-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: Multiple conditions for an IF statement

    Nice and simple, worked perfectly, thanks very much!

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Multiple conditions for an IF statement

    mike, you are just about there...

    =IF(OR(E45={"Oct","Nov","Dec"}),"Yes","No")
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Multiple conditions for an IF statement

    But you were also close since it should work as:

    =if(OR(e45={"OCT","NOV","DEC"}),"YES","NO"}

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1