+ Reply to Thread
Results 1 to 11 of 11

Need help with IF AND OR statement please

  1. #1
    Registered User
    Join Date
    06-03-2014
    Location
    Canton, MI
    MS-Off Ver
    2010
    Posts
    7

    Need help with IF AND OR statement please

    Hello, this is my first post here and i was wondering if i could get some help with this formula. I just cannot get it to work properly.

    here is what I have as of now.

    =IF(AND(OR(ISBLANK(AT2), A2<>"na")),AD2="Fac Exist"),"na","fac exist w/ proj")

    here is what i am trying to do:

    IF AD2="Fac Exist"

    AND

    AT2 is BLANK OR A2 <> "na"

    THEN

    "na"

    IF FALSE

    "fac exist w/ proj"



    any help is VERY much appreciated!!!

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Need help with IF AND OR statement please

    Try this:

    If(and(AD="FAC Exist",or(AT2 = "",A2 <> "na")),"na","fac exist w/proj")
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: Need help with IF AND OR statement please

    One bracket too many perhaps?

    =IF(AND(OR(ISBLANK(AT2), A2<>"na"),AD2="Fac Exist"),"na","fac exist w/ proj")
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Need help with IF AND OR statement please

    You've got an extra ) in there..

    =IF(AND(OR(ISBLANK(AT2), A2<>"na")),AD2="Fac Exist"),"na","fac exist w/ proj")

    Should be
    =IF(AND(OR(ISBLANK(AT2), A2<>"na"),AD2="Fac Exist"),"na","fac exist w/ proj")


    Also, if AT2 is a formula, and it might return "", ISBLANK will not consider that blank.
    Might be better to use
    AT2=""
    =IF(AND(OR(AT2="", A2<>"na"),AD2="Fac Exist"),"na","fac exist w/ proj")

  5. #5
    Registered User
    Join Date
    06-25-2013
    Location
    San Diego, CA
    MS-Off Ver
    Excel 2010
    Posts
    51

    Re: Need help with IF AND OR statement please

    Quote Originally Posted by Brian6751 View Post

    =IF(AND(OR(ISBLANK(AT2), A2<>"na")),AD2="Fac Exist"),"na","fac exist w/ proj")
    Maybe
    =IF(AND(OR(ISBLANK(AT2),A2<>"na"),AD2="Fac Exist"),"na","fac exist w/ proj")

  6. #6
    Registered User
    Join Date
    06-03-2014
    Location
    Canton, MI
    MS-Off Ver
    2010
    Posts
    7

    Re: Need help with IF AND OR statement please

    wow. thanks for all the quick replies

    all of these are returning as "fac exist w/ proj" when AD2 does not equal "Fac Exist". AT2 is BLANK and A2 is "na"

    this cell should be returned as "na"

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Need help with IF AND OR statement please

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  8. #8
    Registered User
    Join Date
    06-03-2014
    Location
    Canton, MI
    MS-Off Ver
    2010
    Posts
    7

    Re: Need help with IF AND OR statement please

    the formula is in B2. i hope this is sufficient

    Sample Workbook.xlsx

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Need help with IF AND OR statement please

    Quote Originally Posted by Brian6751 View Post

    all of these are returning as "fac exist w/ proj" when AD2 does not equal "Fac Exist". AT2 is BLANK and A2 is "na"
    That's what you said you wanted.

    Quote Originally Posted by Brian6751 View Post

    here is what i am trying to do:

    IF AD2="Fac Exist"

    AND

    AT2 is BLANK OR A2 <> "na"

    THEN

    "na"

    IF FALSE

    "fac exist w/ proj"
    I think you need to re-define your expectations for us.
    You have 8 possible combinations of the values in the 3 cells.
    Please answer the following

    AD2="FAC Exist" and AT2 is blank and A2 = na : I want ??
    AD2="FAC Exist" and AT2 is blank and A2 does not = na : I want ??
    AD2="FAC Exist" and AT2 is NOT blank and A2 = na : I want ??
    AD2="FAC Exist" and AT2 is NOT blank and A2 does not = na : I want ??
    AD2 does not = "FAC Exist" and AT2 is blank and A2 = na : I want ??
    AD2 does not = "FAC Exist" and AT2 is blank and A2 does not = na : I want ??
    AD2 does not = "FAC Exist" and AT2 is NOT blank and A2 = na : I want ??
    AD2 does not = "FAC Exist" adn AT2 is NOT blank and A2 does not = na : I want ?

  10. #10
    Registered User
    Join Date
    06-03-2014
    Location
    Canton, MI
    MS-Off Ver
    2010
    Posts
    7

    Re: Need help with IF AND OR statement please

    i realized column A was no longer needed and this worked:

    =IF(AND(NOT(ISBLANK(AT2)),AD2="Fac Exist"),"fac exist w/ proj","na")

    Thank you very much!!

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: Need help with IF AND OR statement please

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  2. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  3. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

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