+ Reply to Thread
Results 1 to 9 of 9

Why My IF is not TRUE

  1. #1
    Registered User
    Join Date
    03-07-2011
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    13

    Why My IF is not TRUE

    I want to escape from the first for, but I was stuck ...
    The condition is false, even if the variables are correct ...
    Can someone help me?
    Attached Images Attached Images

  2. #2
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    Re: Why My IF is not TRUE

    Is Sheets("Statistics") selected?

  3. #3
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Why My IF is not TRUE

    Hi,

    I was able to replicate your problem with this simple example:
    Please Login or Register  to view this content.
    It's a rounding issue due to the way Excel computes and stores numbers under the hood. See if converting to the Currency Data Type is acceptable for you, which will allow for 4 decimal places:
    Please Login or Register  to view this content.
    Hope that helps,

    Colin

    RAD Excel Blog

  4. #4
    Registered User
    Join Date
    03-07-2011
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Why My IF is not TRUE

    Another stupid thing from MS
    I declared variable to single, double... nothing works.
    I force variable with CDbl... nothing.
    2 day lost because this ****.

    Solution: -------------------- CCur -----------------------

    Thank you very much Colin.

  5. #5
    Registered User
    Join Date
    03-07-2011
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Why My IF is not TRUE

    I don't know how i do "SOLVE"

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Why My IF is not TRUE

    It has nothing to do with Microsoft; it is a result of your computer's use of IEEE 754 binary floating point numbers.
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Registered User
    Join Date
    03-07-2011
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Why My IF is not TRUE

    I don't know what it is IEEE754 but stil MS it is.
    I don't modify anything from settings.
    IEEE754, IEEE64 etc. is not my problem.

    XP, Vista, Win7, x86, x64, etc. is not my problem.

    My problem is was a simple variable with value 2 , and condition FALSE!!!!!!!!!!!!!!!

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Why My IF is not TRUE

    I have a dog that barks at the moon ...

  9. #9
    Registered User
    Join Date
    03-07-2011
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Why My IF is not TRUE

    In loc sa scri poezi mai bine imi explicai ce e cu acel IEEE754 si in ce context trebuie eu sa visez unde e problema.
    Stima domnule shg si cautati de lucru in alta parte.

+ 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