+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    06-11-2008
    Location
    UK
    Posts
    25

    Comparison formula - including inherent errors

    Hi

    I would be most grateful if someone can assist me with the following problem - it's killing me!!

    I have two columns that I want to compare - but one of them is the result of a VLOOKUP - so it may actually contain the #N/A error - how can I compare them so that:

    if col 1 agrees with col 2, then "yes" is returned
    if col 1 does not agree with col 2 but the VLOOKUP in col 2 has NOT returned an error (so it's still a valid comparison) then "NO" is returned
    if col 2 shows a VLOOKUP #N/A error then "NO" is returned

    or, perhaps more straightforwardly:

    Col 1 = ABC, col 2 = ABC then return "YES"
    Col 1 = ABC, col 2 = DEF then return "NO"
    Col 1 = ABC, col 2 = #N/A then return "NO"

    Thanks in advance to whoever cracks this for me...

    Many thanks

    Steve
    Last edited by NBVC; 10-05-2009 at 03:02 PM.
    Thanks

    Steve

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Comparison formula - including inherent errors

    Would this do it?

    =IF(ISNA(B1),"No",IF(A1=B1,"Yes","No"))
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    06-11-2008
    Location
    UK
    Posts
    25

    Re: Comparison formula - including inherent errors

    Not unless I've applied it incorrectly, see attached file.

    Thanks
    Attached Files Attached Files
    Thanks

    Steve

  4. #4
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Comparison formula - including inherent errors

    You didn't adjust references in formula you copied to match row you are starting in..

    in C2 you should have:

    =IF(ISNA(B2),"No",IF(A2=B2,"Yes","No"))

    then copy down
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Registered User
    Join Date
    06-11-2008
    Location
    UK
    Posts
    25

    Re: Comparison formula - including inherent errors

    Thanks - that sorted it

    Cheers for your help.
    Thanks

    Steve

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.2.0