+ Reply to Thread
Results 1 to 3 of 3

Formula in Cell causing my comparitor code to give false results

  1. #1
    Registered User
    Join Date
    05-23-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Formula in Cell causing my comparitor code to give false results

    I am having trouble getting my code to run properly. I am pulling in values from another sheet into column A & B via =IF(Repair!B57<>"",Repair!B57,""). I have the below code that runs, which compares the values in columns A & B to columns D & E and if it finds a match outputs on that line that it found a match. I am comparing 5 records and the first 4 work properly, but on the 5th it doesn't. The problem is, for the last record it is not showing me the correct results. If I go in and type the actual value in the cell in column B rather than the formula, it works. Any help is greatly appreciated!

    Code:
    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Formula in Cell causing my comparitor code to give false results

    It can be difficult to debug this sort of thing with the code only. As near as I can quickly tell, the code is syntactically correct. From what you describe, it sounds like it is a problem with the actual values (which we cannot see). My first guess is that the displayed value is rounded (or otherwise different) from the actual value stored in the cells. These rounding errors cause tests like "is A exactly equal to B" to fail. I think you will need to look at the values you are comparing and check to see if they are "exactly equal" or not, and adjust your comparison accordingly.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    05-23-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Formula in Cell causing my comparitor code to give false results

    Thank you MrShorty for reviewing my code. I have my file uploaded to the below link if you have the time to review this. I commented out the code the populates columns D and E so when you click the button you will see the issue. Thanks again!!

    http://www.filedropper.com/comparisonhelp

+ 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. #NUM causing problem with INDEX formula results
    By judecrew in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-29-2015, 06:16 PM
  2. Replies: 12
    Last Post: 09-19-2014, 10:18 PM
  3. [SOLVED] Get Rid of the False Positive Results of the Code.
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2013, 11:01 AM
  4. Replies: 2
    Last Post: 10-30-2013, 10:49 AM
  5. Multiple If Statements Causing "FALSE" in Results
    By NYCNYC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-22-2013, 05:23 PM
  6. Replies: 14
    Last Post: 06-27-2012, 04:26 PM
  7. Formula that will give me True or False results
    By Reenee in forum Excel General
    Replies: 2
    Last Post: 02-02-2009, 10:36 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