+ Reply to Thread
Results 1 to 10 of 10

If statement not working

  1. #1
    Registered User
    Join Date
    06-29-2020
    Location
    Harriman, NY
    MS-Off Ver
    Excel 365 Desktop
    Posts
    22

    If statement not working

    Hello,
    I am trying to compare two columns to see if thy match. They are both street addresses but one can be different simply by the postal code.

    However, when I do an if statement, the results are not correct. I am not sure what I am doing wrong. On the attached spreadsheet, row 3 should come back as "Match"

    Thank you in advance for your help.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-29-2020
    Location
    Harriman, NY
    MS-Off Ver
    Excel 365 Desktop
    Posts
    22

    Re: If statement not working

    i forgot to mention, I trimmed Rows A & B prior to building the if statement.

  3. #3
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2019 H: 365
    Posts
    940

    Re: If statement not working

    Hi Carol Diedolf,

    The first parts of the address don't match.

    - 11 Shr Vw Dr
    - 11 Shore View Dr

    Regards,

    Snook

  4. #4
    Registered User
    Join Date
    06-29-2020
    Location
    Harriman, NY
    MS-Off Ver
    Excel 365 Desktop
    Posts
    22

    Re: If statement not working

    Thank you, Snook.
    Is there a way where I can just compare the postal code?

  5. #5
    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,091

    Re: If statement not working

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    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


  6. #6
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: If statement not working

    Carol, row 3 doesn't match. Excel cannot be as intuitive as we are, and assume that abbreviations are equal to their non-abbreviated counterparts.
    Excel is doing it's job, as defined by the formula. Cleaning it up would most likely be a manual process.
    Perhaps, sort by ZIP code by extracting to a helper column, =right(A3,10) filter the formula column to FALSE's, and go through them looking for falsehoods.

    Hope that helps.

    Pete

  7. #7
    Registered User
    Join Date
    06-29-2020
    Location
    Harriman, NY
    MS-Off Ver
    Excel 365 Desktop
    Posts
    22

    Re: If statement not working

    Thank you, so much everyone. I believe this is resolved

    Have a great day!
    Carol

  8. #8
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2019 H: 365
    Posts
    940

    Re: If statement not working

    You're welcome Carol, you too.

    Snook

  9. #9
    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,091

    Re: If statement not working

    You're welcome.

  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,091

    Re: If statement not working

    Thanks for the rep.

    Hope the next few weeks are good for you; seems like a tough time over there, one way and another.

+ 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. [SOLVED] If Statement Not Working
    By brentjohn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-09-2020, 10:41 AM
  2. [SOLVED] If statement on working out percentage and based on time and date not working.
    By Johnny247 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-11-2019, 06:07 PM
  3. multiple if statement not working but not working (make sense!)
    By vanessafvg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2018, 12:06 AM
  4. If Then Statement Not Working
    By MMCHouston in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2015, 03:48 PM
  5. IF Statement Not Quite Working
    By jimmydougle in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-18-2013, 05:52 AM
  6. Working While Statement Stops Working
    By Verbaruab in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-10-2011, 05:58 PM
  7. If statement not working
    By lit2003 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2008, 09:33 AM

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