Title: If statements
Last modified: August 22, 2016

---

# If statements

 *  Resolved [HappyListing](https://wordpress.org/support/users/happylisting/)
 * (@happylisting)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/if-statements-2/)
 * Why do if statements not work?
 * This doesnt work
    IF(fieldname2<55000,fieldname2*0.005)
 * This works
    IF(400000<fieldname2,(fieldname2*0.02)-3525)
 * I read all your documentation and some 4 year old kid wrote it all.
    Not helpful
   at all.
 * [https://wordpress.org/plugins/calculated-fields-form/](https://wordpress.org/plugins/calculated-fields-form/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [barnez](https://wordpress.org/support/users/pidengmor/)
 * (@pidengmor)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/if-statements-2/#post-5940056)
 * >  There are three ways to use conditional statements in the equations:
   > Using the IF operation (don’t confuse the operation “IF” with the reserved 
   > word “if” of javascript, the code in javascript is case sensitive)
   > IF( condition, value if true, value if false)
   > For example, if the result of the equation is 100 when the value of fieldname1
   > is less than 100 and 1000 in another case, the equation would be:
   > IF(fieldname1<100,100,1000)
   > Using the ternary operator of javascript
   > (condition) ? value if true : value if false
   > Following the same example in the previous point:
   > (fieldname1<100) ? 100 : 1000
   > With a more powerful equation
   > (function(){
   >  if( fieldname1 < 100) return 100; else return 1000; })()
 * If my four year old had written this I’d be packing him off to Silicone Valley
   and requesting early retirement. I would say the developers of this free plugin
   have invested plenty of quality time and effort in supporting the plugin through
   detailed FAQs and multiple responses here to various common scenarios.
 * IMO this is an excellent and powerful calculating form plugin – up there as one
   of the best in its field in the repository. As with any non plug-and-play plugin
   it requires takes careful reading of the documentation, trial-and-error experimentation,
   and if all else fails, a polite request to the developers for advice.
 * Good luck!
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/if-statements-2/#post-5940096)
 * Hi,
 * I’m sorry for the delay answering to your question. The reason that your equation
   is failing, is really simple:
 * IF(fieldname2<55000,fieldname2*0.005)
 * The operation IF has three parameters: the condition, the value to return if 
   the condition is true, and the value to return if the condition is false. You
   have omited the third parameter. So, if the value of fieldname2 is bigger than
   55000, the operation result would be empty.
 * Best regards.
 *  Thread Starter [HappyListing](https://wordpress.org/support/users/happylisting/)
 * (@happylisting)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/if-statements-2/#post-5940098)
 * Im sorry thats not a sufficient answer.
 * Both IF statements do not have the false condition so how do you explain that?
 * Why doesn’t the documentation have many examples not just how to calculate 1+
   1 because it seems that’s what this plugin is only good for.
 *  Thread Starter [HappyListing](https://wordpress.org/support/users/happylisting/)
 * (@happylisting)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/if-statements-2/#post-5940099)
 * Ok I was able to get it but no thanks to your “documentation”
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [11 years, 3 months ago](https://wordpress.org/support/topic/if-statements-2/#post-5940101)
 * What was unclear about this?
 * > The operation IF has three parameters: the condition, the value to return if
   > the condition is true, and the value to return if the condition is false.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘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/)

 * 5 replies
 * 4 participants
 * Last reply from: [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/if-statements-2/#post-5940101)
 * Status: resolved