Forum Discussion

DanielReam's avatar
DanielReam
Qrew Member
3 years ago

Using IF to compare values in two form fields

I'm using a rich text - formula field to compare currency amounts in two form fields within the same form.  So far this is what I have:

IF([Amount 1]=[Amount 2],
"<font color=green><b>Values Match</font></b>",
"<font color=red><b>Values Do Not Match</font></b>")

Currently even if the values match I'm getting the "Values Do Not Match" response.  

What am I missing or what have I done wrong?

------------------------------
Daniel Ream
Builder
------------------------------

4 Replies

  • The likely cause is that the values in fact do not match and your formula is correct.

    Is it possible that these two fields are not identical in value right down to the last decimal place? Are these data entry fields or are they as a result of a calculation. If they are the result of a calculation I suggest using the Round function in their formulas to round them to 2 decimal places. 


    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • DanielReam's avatar
      DanielReam
      Qrew Member
      I have the same concern.  

      [Amount 1] is a manual input amount 

      [Amount 2] is a formula field using Query & Sum.  Thinking it's something past the second decimal place.  Have gone out as far as 10 decimal places but I'm not seeing anything obvious.


      ------------------------------
      Daniel Ream
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Try using the Round function.

        Round( ...put your existing formula here, 0.01)


        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------