Title: Variable Result from a Slider
Last modified: June 19, 2020

---

# Variable Result from a Slider

 *  Resolved [Graicifyd](https://wordpress.org/support/users/graicifyd/)
 * (@graicifyd)
 * [6 years ago](https://wordpress.org/support/topic/variable-result-from-a-slider/)
 * Hi,
 * Thank you for your support always.
 * I have a created a slider with range number 1 – 1,000,000.
 * I want a result where a particular range will be multiplied by a number I defined.
   For instance if 1 – 10, 000 is selected, the result will be (1-10,000)* 2 and
   if (10001 – 50,000) is selected the result will be (1-10,000)*2 + (10001 – 50,000)*
   3
 * So I created this formula
 * IF( fieldname1<10000, fieldname1*2,fieldname1>10000, fieldname1*3 )
 * It works for the first part of <10000 but once it gets above 10000it returns ‘
   true’ as the answer. Please can you help me with it.
 * I still want to create more rules for milestones like 100, 000, 500, 000 etc.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fvariable-result-from-a-slider%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years ago](https://wordpress.org/support/topic/variable-result-from-a-slider/#post-13008102)
 * Hello [@graicifyd](https://wordpress.org/support/users/graicifyd/)
 * You cannot pas more than three parameters to the “IF” operation,
    because the
   structure of the “IF” operation is:
 * `IF(condition, result if condition true, resut if condition false)`
 * Put you can nesting multiple “IF” operations.
 * The following equation is hypothetical because you don’t have described the operations
   in case fieldname1 be over 50000:
 *     ```
       IF(fieldname1<10000, fieldname1*2,IF(fieldname1<50000, 10000*2 + (fieldname1-10000)*3,  10000*2 + 50000*3 + (fieldname1-50000)*3))
       ```
   
 * However, in cases similar to yours would be easier to understand, using function
   structure with “if” conditional statements instead “IF” operations:
 *     ```
       (function(){
       if(fieldname1<10000) return fieldname1*2;
       if(fieldname1<50000) return 10000*2 + (fieldname1-10000)*3;
       return  10000*2 + 50000*3 + (fieldname1-50000)*3;
       })()
       ```
   
 * Best regards.
 *  Thread Starter [Graicifyd](https://wordpress.org/support/users/graicifyd/)
 * (@graicifyd)
 * [6 years ago](https://wordpress.org/support/topic/variable-result-from-a-slider/#post-13008247)
 * Thank you for your respnse, it was really helpful. How do I write a statement
   saying ‘If fieldname1 is less than 50, 000 and greater than 10, 000?
 * I tried his IF(fieldname1<50000,>10000) it didn’t work.
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years ago](https://wordpress.org/support/topic/variable-result-from-a-slider/#post-13008325)
 * Hello [@graicifyd](https://wordpress.org/support/users/graicifyd/)
 * Please read the structure of the `IF` operation, I described it in the previous
   entry, you are using it with a wrong structure again.
 * If you want to check for a value into a range, you should to compare with both
   corners but using the `AND` operation or the and operator `&&`
 *     ```
       AND(10000<fieldname1, fieldname1<50000)
       ```
   
 * or
 *     ```
       10000<fieldname1 && fieldname1<50000
       ```
   
 * Best regards.

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

The topic ‘Variable Result from a Slider’ 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: [6 years ago](https://wordpress.org/support/topic/variable-result-from-a-slider/#post-13008325)
 * Status: resolved