Title: If function problem
Last modified: August 21, 2016

---

# If function problem

 *  Resolved [psq1](https://wordpress.org/support/users/psq1/)
 * (@psq1)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/if-function-problem/)
 * Hi!
    First of all I got to say that this is awesome plugin!
 * Could you help me to get this form done. Im having troubles understanding the
   IF funcition.
 * So here is the summary function I have made
 * (fieldname1+fieldname2*1.05)*fieldname9
 * I would like it to work so that (fieldname1+fieldname2) would only be multiplied
   with 1.05 if those two combined is 150 or over.
 * Another thing that would be nice is that if (fieldname1+fieldname2) combined 
   would be 22 or under nothing would be added or multiplied.
 * Hope you understand what Im meaning.
    Best regards, psq1
 * [https://wordpress.org/plugins/calculated-fields-form/](https://wordpress.org/plugins/calculated-fields-form/)

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/if-function-problem/#post-5003741)
 * Hi,
 * Maybe I have not understood your equation, but I think the correct is:
 * (function(){
    var v = fieldname1+fieldname2; if(v<=22) return v; if(v>=150) return
   v*1.05*fieldname9; return v*fieldname9; })()
 * Best regards.
 *  Thread Starter [psq1](https://wordpress.org/support/users/psq1/)
 * (@psq1)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/if-function-problem/#post-5003864)
 * Thank you so much! It seems to work perfect, can I donate somewhere to you? 🙂
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/if-function-problem/#post-5003867)
 * Hi,
 * A good review is always appreciated 😉
 * Best regards.

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

The topic ‘If function problem’ 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/)

 * 3 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/if-function-problem/#post-5003867)
 * Status: resolved