Title: complex &#8220;Calculated Fields Form&#8221;
Last modified: July 18, 2018

---

# complex “Calculated Fields Form”

 *  Resolved [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/complex-calculated-fields-form/)
 * I am using a Calculated field with this Equation:
    PREC(MAX(3.9,fieldname7*0.60
   +2.70),2)
 * I would like to add something like this:
    if(fieldname2 > 100) return fieldname35
 * or (even better):
    if(fieldname2 > 100) then display a warning text
 * In other words: if the value of fieldname 2 is above 100 I would like this calculated
   field to display (field35 which then shows) a warning text.
 * Is that possible,
    Alwin

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/complex-calculated-fields-form/#post-10505032)
 * Hello [@wp-opti](https://wordpress.org/support/users/wp-opti/),
 * In this case you can edit the equation as follows:
 *     ```
       (function(){
       var result = MAX(3.9,fieldname7*0.60+2.70);
       if(100 < result) return PREC(result,2);
       return 'Warning message here';
       })()
       ```
   
 * or if you prefer an alert:
 *     ```
       (function(){
       var result = MAX(3.9,fieldname7*0.60+2.70);
       if(100 < result) return PREC(result,2);
       alert('Warning message here');
       return '';
       })()
       ```
   
 * Best regards.
 *  Thread Starter [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/complex-calculated-fields-form/#post-10505319)
 * Thank you very much for your help! However, this is not going to work for me.
   I think I did not explain very good what I want. I will try again:
 * I am using a Calculated field with this Equation:
    PREC(MAX(3.9,fieldname7*0.60
   +2.70),2) In my Form this Calculated field is “fieldname13”.
 * Then I am using antoher field, called “fieldname2” which is a Number field.
 * Now when the value in fieldname2 is above 100, then I would like to display a
   warning in the fieldname13.
 * In other words: when the value in fieldname2 is above 100 then fieldname13 should
   display a warning.
 * Is that possible?
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/complex-calculated-fields-form/#post-10505332)
 * Hello [@wp-opti](https://wordpress.org/support/users/wp-opti/),
 * In this case the equation would be simpler:
 *     ```
       IF(100<=fieldname2, PREC(MAX(3.9,fieldname7*0.60+2.70),2), 'Warning message here')
       ```
   
 * Best regards.
 *  Thread Starter [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/complex-calculated-fields-form/#post-10505746)
 * That works; great!
 * Now I like to add 1 more thing:
 * I now have this rule: IF(100<=fieldname2
 * I also like to add a second one: IF(200<=fieldname6
 * How can I add this one to the equation?
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/complex-calculated-fields-form/#post-10505854)
 * Hello [@wp-opti](https://wordpress.org/support/users/wp-opti/),
 * I’m sorry, but your description is ambiguos, do you want return the result if
   both conditions are true? If it is the case, the equation would be:
 *     ```
       IF(AND(100<=fieldname2,200<=fieldname6), PREC(MAX(3.9,fieldname7*0.60+2.70),2), 'Warning message here')
       ```
   
 * If you need additional help implementing your project’s equations I can offer
   you a custom coding service from my private website:
 * [https://cff.dwbooster.com/customization](https://cff.dwbooster.com/customization)
 * Best regards.
 *  Thread Starter [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/complex-calculated-fields-form/#post-10505877)
 * I want to return the warning if (100<=fieldname2 OR (200<=fieldname6
 * So not AND but OR
 * Hope you understandf now 😉
 * Alwin
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/complex-calculated-fields-form/#post-10505887)
 * Hello [@wp-opti](https://wordpress.org/support/users/wp-opti/),
 * Simply replace the AND by OR in the previous equation:
 *     ```
       IF(OR(100<=fieldname2,200<=fieldname6), PREC(MAX(3.9,fieldname7*0.60+2.70),2), 'Warning message here')
       ```
   
 * I’m sorry, but the support service does not cover the implementation of users’
   projects (forms or formulas). If you need additional support to implement your
   project’s equations, you should request a custom coding service through my private
   website:
 * [https://cff.dwbooster.com/customization](https://cff.dwbooster.com/customization)
 * Best regards.
 *  Thread Starter [Alwin](https://wordpress.org/support/users/wp-opti/)
 * (@wp-opti)
 * [8 years ago](https://wordpress.org/support/topic/complex-calculated-fields-form/#post-10507885)
 * I understand. I will also buy the pro version of the plugin now.
 * Thank you so far with this topic!
 * Regards,
    Alwin

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

The topic ‘complex “Calculated Fields Form”’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form - AI Form Builder for WordPress - Contact, Payment, Quote, Quiz & More](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/)

 * 8 replies
 * 2 participants
 * Last reply from: [Alwin](https://wordpress.org/support/users/wp-opti/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/complex-calculated-fields-form/#post-10507885)
 * Status: resolved