+ Reply to Thread
Results 1 to 2 of 2

Simple If Statement Help

  1. #1
    Registered User
    Join Date
    07-26-2010
    Location
    US
    MS-Off Ver
    Excel 2003
    Posts
    23

    Question Simple If Statement Help

    Hey all,

    I'm writing a simple if statement and cannot figure out the proper syntax. Here's what I'm trying to say:

    If (A1=1) AND (B1= 1 or 2 or 3 or 4), then insert a 1.

    How do I incorporate the ors inside the and?

  2. #2
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Simple If Statement Help

    =and(a1=1,or(b1=1,b1=2,b1=3,b1=4))

    or (if B1 is limited to integers)

    =and(a1=1,b1>0,b1<5)
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

+ 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