0
  • Number field "QuantiteStockageConteneur" = 7922.55
  • Currency field "TauxStockageConteneur" = 0.28
  • Currency field "StockageDeConteneur_ParPiedCube" = 2218.31

Fields screenshot

I have tried:

=IF([QuantiteStockageConteneur]*[TauxStockageConteneur]=[StockageDeConteneur_ParPiedCube],TRUE,FALSE)

Original language (copy & paste):

=SI([QuantiteStockageConteneur]*[TauxStockageConteneur]=[StockageDeConteneur_ParPiedCube];VRAI;FAUX)

It returns FALSE.

So I wondered what is the actual value returned. So I made a calculated column taking the same formula.

It returns the same value.

A calculated column returning the result of the previous calculation returns the same value as the number I entered in the form

So I tried:

=IF([CalculTestStockageConteneur]=[StockageDeConteneur_ParPiedCube],TRUE,FALSE)

Original language (copy & paste):

=SI([CalculTestStockageConteneur]=[StockageDeConteneur_ParPiedCube];VRAI;FAUX)

Still FALSE.

The columns have the same value, yet the if statement returns false

The problem is not yes/no. I tried having it return 1 or 0 as a number calculated field, it returned 0 (FALSE).

I tried "OUI" ("YES") and "NON" ("NO") in place of VRAI (TRUE) and FAUX (FALSE), same thing.

It's simple, yet it doesn't work. Any idea?

Thank you,

1 Answer 1

0

Little tweaking you need to do in the formula as it's not able to compare the exact values. It worked for me while doing the Round up of the values. So, you can try the below one -

Round([QuantiteStockageConteneur]*[TauxStockageConteneur],0)=Round([StockageDeConteneur_ParPiedCube],0)

Don't need to put the if as well if the return type is Yes/No only.

1
  • Thanks, there's a slight risk the results could be different but it's close enough. So, if-statements cannot compare floating-point numbers? Commented Apr 25, 2022 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.