Title: Using IF statements
Last modified: August 16, 2023

---

# Using IF statements

 *  Resolved [dankarr](https://wordpress.org/support/users/dankarr/)
 * (@dankarr)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/using-if-statements/)
 * ![](https://agent.valchoice.com/calculators/carriers/)
 *     ```wp-block-code
       (function(){
           if(fieldname3=85)
           {
              return (((fieldname10-fieldname18)*600)+(((fieldname10-fieldname18)*fieldname33)*0.115));
           }
           else
           {
               return filename18;
           }
       })()
   
       What is wrong with this code. On the URL page you will see the calculator this is applied to. The box at the bottom that says "Your first year profit increase..." is where this should insert a number. 
       ```
   
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fusing-if-statements%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)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/using-if-statements/#post-16978618)
 * Hello [@dankarr](https://wordpress.org/support/users/dankarr/)
 * Thank you very much for using our plugin. In Javascript, the equality operator
   is the double symbol `==`. The single symbol `=` is used for assignment.
 * So, the equation would be:
 *     ```wp-block-code
       (function(){
           if(fieldname3==85)
           {
              return (fieldname10-fieldname18)*600+(fieldname10-fieldname18)*fieldname33*0.115;
           }
           else
           {
               return filename18;
           }
       })()
       ```
   
 * Note that you can use the IF operation in this case and make the equation simpler:
 *     ```wp-block-code
       IF(fieldname3==85, (fieldname10-fieldname18)*600+(fieldname10-fieldname18)*fieldname33*0.115, filename18)
       ```
   
 * Best regards.

Viewing 1 replies (of 1 total)

The topic ‘Using IF statements’ 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: [2 years, 9 months ago](https://wordpress.org/support/topic/using-if-statements/#post-16978618)
 * Status: resolved