Title: If function
Last modified: January 28, 2019

---

# If function

 *  Resolved [cingrosso](https://wordpress.org/support/users/cingrosso/)
 * (@cingrosso)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/if-function-2/)
 * Can you please tell me what I am doing wrong?
    The first 3 fields are ok, in 
   the 4th I put the following condition: IF(fieldname4 = 0, 0, fieldname9-5) But
   the calculator does not compute…
 * Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fif-function-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/if-function-2/#post-11137249)
 * Hello [@cingrosso](https://wordpress.org/support/users/cingrosso/)
 * The issue is simple, in javascript the operator for equality is the double sign:“
   ==” because the sign “=” is used for assignment. So, the correct equation would
   be:
 *     ```
       IF(fieldname4 == 0, 0, fieldname9-5)
       ```
   
 * and that’s all.
    Best regards.

Viewing 1 replies (of 1 total)

The topic ‘If function’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/if-function-2/#post-11137249)
 * Status: resolved