Forum Discussion

zazaz1's avatar
zazaz1
Copper Contributor
Jan 07, 2020

Strange error when "if" function is used

I'm fighting whit a problem when I use "IF" function in a file like to the one attached...

If I write a simple formula like the ones in coloumn "E", the results are ever correct.

But, if i use the "IF" function to drive in different manner the same formula, like in coloumn "D", sometimes Excel return a strange error, like the ones in the cell written in red...

What is happening? What's wrong?

 

Thank you.

6 Replies

  • Rich99's avatar
    Rich99
    Iron Contributor

    Hi zazaz1 if you look at the cells in red you will see they are formatted as General, Change the format to Number and the results changes to zero. The number you see is actually defaulted to Scientific.

     

    Rich 

    • SergeiBaklan's avatar
      SergeiBaklan
      Diamond Contributor

      Rich99 

      The number will be shown as zero, but actually that will be another (small) number. If compare to zero result will be FALSE.

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    zazaz1 

    Nothing goes wrong, but some of your calculations cause so-called floating point errors. E.g. your formula in D5 returns "0.00000000000001421085" which equals zero up to 13th decimal. By the way, your calculations don't seem very meaningful, but if you insist to do them you need to wrap them in a ROUND statement, e.g. like =ROUND(<your formula>,0)

     

Resources