+ Reply to Thread
Results 1 to 10 of 10

Need Help combining 2 if conditions

  1. #1
    Registered User
    Join Date
    12-20-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    40

    Need Help combining 2 if conditions

    Can someone help on this simple if statement. I am trying to combine 2 conditions such that:

    IF B7=E7 or if A7=D7, return "Match" if true, "0" if not. Is this the correct statement to use:


    =IF(B7=E7,"Match","0"),IF(A7=D7,"Match","0")

    Appreciate any help,
    Thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: Need Help combining 2 if conditions

    =IF(OR(B7=E7,A7=D7),"Match",0)


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Need Help combining 2 if conditions

    If(or(B7=E7,A7=D7),"Match","0")
    Please click the * icon below if I have helped.

  4. #4
    Registered User
    Join Date
    11-26-2011
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Need Help combining 2 if conditions

    Try =IF(OR(B7=E7,A7=E7),"Match", "0")

  5. #5
    Registered User
    Join Date
    12-20-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Need Help combining 2 if conditions

    Thanks for your help. When using your corrected formula, it works but I'm still getting #N/A on some of my lines that should be equal.
    This is what it looks like:

    Column A Column B Column C Column D Column E
    Row 7: BSER IOWA Match BSER Match BSER Master Match BSER KEY IOWA BSER KEY Not IOWA
    #N/A 01F022436-574661 #N/A 01F022436-31IR1 01F022436-574661

  6. #6
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Need Help combining 2 if conditions

    You should upload a sample workbook NYC4LIFE.

  7. #7
    Registered User
    Join Date
    12-20-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Need Help combining 2 if conditions

    see attached for sample line. Thanks!
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Need Help combining 2 if conditions

    The error is because of the #N/A being returned byyour formula in column A.
    You should replace the formula in column A from "XXXXX" to "=IFERROR(XXXXX,"").
    This will make the IF formula work.

  9. #9
    Registered User
    Join Date
    12-20-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: Need Help combining 2 if conditions

    Great! Thanks it worked! Thanks for your help!

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: Need Help combining 2 if conditions

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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