+ Reply to Thread
Results 1 to 7 of 7

Nested if statement correction

  1. #1
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Nested if statement correction

    Hi Gurus,
    I am trying to do an IF statement with multiple conditions, but don't succeed.
    52000 in column C has to match with 'EXPENSED' in column A, the result in column D should display 'YES'.
    15542 in column C has to match with 'CAPITALIZED' in column A, the result in column D should display 'YES'.
    If neither case is true, column D should display 'NO'.
    My formula misses a lot of parts.
    Thank you for your help!
    Attached Files Attached Files
    Last edited by kisboros; 04-05-2013 at 08:08 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,942

    Re: Nested if statement correction

    =if(or(c2="15542",c2="52000"),"yes","no")

    or if the text has to match as well...
    =IF(OR(AND(C2="15542",A2="Capitalized"),AND(C2="52000",A2="Expensed")),"YES","NO")
    Last edited by FDibbins; 04-05-2013 at 07:53 PM.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    04-05-2013
    Location
    dublin, Ireland
    MS-Off Ver
    Excel 2007/10
    Posts
    26

    Re: Nested if statement correction

    =IF(OR(AND(C2="15542",A2="CAPITALIZED"), AND(C2="52000",A2="EXPENSED")), "YES","NO")

    Using OR(first requirement, second requirement, etc) and and(first requirement, second requirement) together as per the above formula

  4. #4
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Nested if statement correction

    To FDibbins: Above code doesn't take it into consideration that 52000 or 15542 has to match with EXPENSED or CAPITALIZED in column A respectively.. So TRUE is only when either CAPITALIZED is in column A and 15542 is in column C, or EXPENSED is in column A and 52000 is in column C on the same row.
    Sorry if I wasn't clear enough. Thank you.
    Last edited by kisboros; 04-05-2013 at 08:04 PM. Reason: Left out addressee

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,942

    Re: Nested if statement correction

    if this is not what you want, please include your expected outcome in your sample file (manually entered)

  6. #6
    Forum Contributor
    Join Date
    01-18-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    128

    Re: Nested if statement correction

    Thank you very much to both of you.

  7. #7
    Registered User
    Join Date
    04-05-2013
    Location
    Honolulu, HI
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Nested if statement correction

    Thank you for this topic. It helped me in what I needed to do as well

+ 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