Title: Adding value by years
Last modified: March 4, 2020

---

# Adding value by years

 *  Resolved [buptrick](https://wordpress.org/support/users/buptrick/)
 * (@buptrick)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-value-by-years/)
 * Hello,
    First of all I want to thank you for your plugin.
 * My problem is this: the worker has a “tax refund” on the wage calculation form.
   this changes every year. I added the ones for 2020 to the “Marital Status Information”
   field. But can there be an alternative choice for 2019 and 2018 to make a retrospective
   calculation?
    Thank you so much.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fadding-value-by-years%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-value-by-years/#post-12506566)
 * Hello [@buptrick](https://wordpress.org/support/users/buptrick/)
 * I’ve visited your web page, and I see you have inserted a radio buttons field
   to select the year, so, I guess you have found the solution.
 * Best regards.
 *  Thread Starter [buptrick](https://wordpress.org/support/users/buptrick/)
 * (@buptrick)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-value-by-years/#post-12506893)
 * Actually I couldn’t find a solution. The data in the form belongs to 2020. There
   must be 8 marital status information in 1 year. Likewise, if I entered 2019 to
   2018, wouldn’t the form be too long?
 *  Thread Starter [buptrick](https://wordpress.org/support/users/buptrick/)
 * (@buptrick)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-value-by-years/#post-12506927)
 * for example;
    2020 TABLE 2019 TABLE Single 220.68 TL 191.85 TL Married, unemployed
   264,82 TL 230.22 TL Married, unemployed, with 1 child 297,92 TL 259.00 TL Married,
   unemployed, with 2 children 331,03 TL 287.78 TL Married, unemployed, with 3 children
   375,17 TL 326.15 TL Married, spouse working 220,68 TL 191.85 TL Married, spouse,
   1 child 253,79 TL 220.63 TL Married, spouse working, with 2 children 286,89 TL
   249.41 TL Married, spouse working, with 3 children 331.03 TL 287.78 TL Married,
   spouse working, with 4 children 353,09 TL 306.96 TL Married, spouse working, 
   with 5 children 375,17 TL 326.15 TL
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/adding-value-by-years/#post-12507524)
 * Hello [@buptrick](https://wordpress.org/support/users/buptrick/)
 * The equation requires some “if” conditional statements, and “IF” operations. 
   I’ll try to describe the process with a hypothetical example:
 * – Assuming the fieldname1 is a dropdown field with two options: 2020, and 2019
   –
   fieldname2 another dropdown field with the choices: Single and Married – fieldname3
   dropdown field with the choices: unemployed and spouse working – fieldname4 dropdown
   field for children with the choices: 0, 1, 2, 3, 4, 5
 * In this hypothetical case the equation can be implemented as follows (the equation
   is partial but give you the idea of its implementation):
 *     ```
       (function(){
           if(fieldname1 == 2020)
           {
               if(fieldname2 == 'Single') return 220.68;
               else
               {
                   switch(fieldname4)
                   {
                       case 0: return IF(fieldname3 == 'unemployed', 264.82, 220.68);
                       case 1: return IF(fieldname3 == 'unemployed', 297.92, 253.79);
                       case 2 return IF(fieldname3 == 'unemployed', 331.03, 286.89);
                       case 3: return IF(fieldname3 == 'unemployed', 375.17, 331.03);
                       case 4: if(fieldname3 == 'spouse working') return 353.09;
                   }
               }
           }
           else
           {
               /** Repeat the process but this time with the values of 2019**/
           }
       })()
       ```
   
 * Best regards.
    -  This reply was modified 6 years, 3 months ago by [codepeople](https://wordpress.org/support/users/codepeople/).

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

The topic ‘Adding value by years’ 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/)

 * 4 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/adding-value-by-years/#post-12507524)
 * Status: resolved