Title: Calculation with if/else Syntax?
Last modified: February 10, 2021

---

# Calculation with if/else Syntax?

 *  Resolved [jesi707](https://wordpress.org/support/users/jesi707/)
 * (@jesi707)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/calculation-with-if-else-syntax/)
 * Hi,
    I am creating a website for a printing shop. They want a form to calculate
   prices for printing products e.g. project work or master thesis. The link to 
   the page shows an form made with forminator but without calculations. But the
   form is the basic for the calculation I descripe in the following.
 * The price of the different products depends e.g. on number of pages, type of 
   paper and more.
    So e.g. if its a master thesis (drop-down-field) with normal
   paper cost for until 100 pages 0,1$ each page until 200 pages 0,08$ each page
   up to 200 pages 0,05$ each page (page is a input field of numbers)
 * So e.g. if its a master thesis with special paper cost for
    until 100 pages 0,2
   $ each page until 200 pages 0,15$ each page up to 200 pages 0,10$ each page
 * So e.g. if its a project work normal paper cost for
    until 100 pages 0,12$ each
   page until 200 pages 0,09$ each page up to 200 pages 0,07$ each page
 * So what I want to show: the price depends on different options. To Calculate 
   this I will need If/else-instructions.
 * e.g.
    If (drop-down-field == “master thesis”) { if (page-number <= 100){ page-
   number * 0,1 } if (page-number <= 200){ page-number * 0,08 } if (page-number 
   > 200){ page-number * 0,05 } } else if(drop-down-field == “project work”{…}
 * Is if/else possible with the calculator and how is the Syntax?
 * Kind regards,
 * J.Fetzer
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcalculation-with-if-else-syntax%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [jesi707](https://wordpress.org/support/users/jesi707/)
 * (@jesi707)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/calculation-with-if-else-syntax/#post-14029705)
 * BTW: I already read the documentary and there I found nothing about if/else in
   the calculator.
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/calculation-with-if-else-syntax/#post-14031983)
 * Hi [@jesi707](https://wordpress.org/support/users/jesi707/)
 * I hope you’re well today and thank you for your question!
 * You’re right, there’s no “if/else” calculations yet.
 * If this is just a few “combinations” of possible options it might be possible
   to achieve it with conditionally visible fields where e.g. you set an additional
   field for “per page” price that’s set to be visible conditionally depending on
   values of the work type and paper type fields and then used in calculation. But
   with a huge number of options it might quickly get very complex, I’m afraid, 
   and I’m not sure if it would work well in this case.
 * We do, however have plans for such “if this than that” type of conditional logic
   that would also cover cases exactly like this one. I don’t have an ETA currently
   but it’s planned to be implemented in future.
 * Kind regards,
    Adam
 *  Thread Starter [jesi707](https://wordpress.org/support/users/jesi707/)
 * (@jesi707)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/calculation-with-if-else-syntax/#post-14039856)
 * Okay, thank you for your fast reply

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

The topic ‘Calculation with if/else Syntax?’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

## Tags

 * [else](https://wordpress.org/support/topic-tag/else/)
 * [if](https://wordpress.org/support/topic-tag/if/)

 * 3 replies
 * 2 participants
 * Last reply from: [jesi707](https://wordpress.org/support/users/jesi707/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/calculation-with-if-else-syntax/#post-14039856)
 * Status: resolved