+ Reply to Thread
Results 1 to 4 of 4

IF AND Statement question

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    Illinois
    MS-Off Ver
    Microsoft 360
    Posts
    58

    IF AND Statement question

    This is my first post so I hope someone can help with something that I believe should be easy. Below is an IF AND statement that works for me ... if B19=John and B18=Mary, the the answer will be the value in cell D202. If both of those criteria do not exist, the the answer will be the sum of D202 and D203.

    =IF(AND(B19="John",B18="Mary"),D202,D202+D203)

    However, I would like to also add that if B19=John AND B18 equals either Mary OR Jane, then the answer will be the value in D202. If any other selections are made other than the combination of "John and Mary" or "John and Jane" then the answer will be the sum of D202 and D203. I have a long validation list (and will add more as time goes on) in B19 and B18 but unless any of these 2 combinations exist I need to add D202 and D203 together.

    I have gotten so close and thought I had it, only to come up with some error message. I even came up with a TRUE or FALSE but that obviously isn't what I need. I thought of a Match table but that didn't seem right either as there would be too many options because of the long validation list.

    Thanks everyone ... I hope I can be of help as time goes by also!

    Joe

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: IF AND Statement question

    Try this:

    Please Login or Register  to view this content.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: IF AND Statement question

    Try it like this:

    =IF(AND(B19="John",OR(B18="Mary",B18="Jane")),D202,D202+D203)

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    09-18-2012
    Location
    Illinois
    MS-Off Ver
    Microsoft 360
    Posts
    58

    Re: IF AND Statement question

    Conne and Pete ... works perfectly ... thanks much! Now I see how it makes sense.

+ 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