Title: Calculation function
Last modified: September 1, 2022

---

# Calculation function

 *  Resolved [johnt22](https://wordpress.org/support/users/johnt22/)
 * (@johnt22)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/calulation-function/)
 * I’m making an estimate form with the calculated form plugin, and I’m trying to
   add a function to get the date, if it’s a Sunday I wanna add $10 to the summary
    -  This topic was modified 3 years, 7 months ago by [johnt22](https://wordpress.org/support/users/johnt22/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcalulation-function%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/calulation-function/#post-15969640)
 * Hello [@johnt22](https://wordpress.org/support/users/johnt22/)
 * Thank you very much for using our plugin. I’ll try to describe the process with
   a hypothetical equation.
 * Assuming you have the equation `fieldname1+fieldname2` and you want to add $10
   to the previous sum if the user selects a Sunday through the date field fieldname3.
 * The plugin includes the `WEEKDAY` operation that returns the number 1 for Sunday.
   So, you can edit the hypothetical equation as follows:
 * `fieldname1+fieldname2+IF(WEEKDAY(fieldname3) == 1, 10, 0)`
 * Best regards.

Viewing 1 replies (of 1 total)

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

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

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