Title: Statistics &#8211; Complex Formula
Last modified: September 13, 2021

---

# Statistics – Complex Formula

 *  Resolved [punitganshani](https://wordpress.org/support/users/punitganshani/)
 * (@punitganshani)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/statistics-complex-formula/)
 * I am trying to build a formula in statistics for tennis, which supports following
 * S1 (for) + S2 (for) + S3 (for) – S1 (against) – S2 (against) – S3 (against)
 * However, I want the value to be either 0 or +ve. How do I apply this condition?

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

 *  [Roch](https://wordpress.org/support/users/rochesterj/)
 * (@rochesterj)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/statistics-complex-formula/#post-14867294)
 * Hi there!
 * Thanks for reaching out.
 * You can use the conditionals for that.
 * `( (S1 (for) + S2 (for) + S3 (for) – S1 (against) – S2 (against) – S3 (against))
   > 0 ) * (S1 (for) + S2 (for) + S3 (for) – S1 (against) – S2 (against) – S3 (against))`
 * The first big parenthesis is checking if the points you have is bigger than zero,
   if yes it returns one, otherwise it returns zero. Then we multiply the result
   of our check (one if true, zero if not) by the actual points value.
 * So if your points formula returns -1, you’ll have:
    `0 * -1 = 0`
 * And if it’s 9, for example, then you’ll have:
    `1 * 9 = 9`
 * Thanks!
 *  Thread Starter [punitganshani](https://wordpress.org/support/users/punitganshani/)
 * (@punitganshani)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/statistics-complex-formula/#post-14867391)
 * I tried this but the value is appearing 0 for all entries
 * Here, [https://imgur.com/a/Esybszs](https://imgur.com/a/Esybszs)
    -  This reply was modified 4 years, 8 months ago by [punitganshani](https://wordpress.org/support/users/punitganshani/).
 *  [Roch](https://wordpress.org/support/users/rochesterj/)
 * (@rochesterj)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/statistics-complex-formula/#post-14867533)
 * Hi!
 * What did you have as the values for the items that are as zero?
 * Or maybe what happens if you add a new column with just this portion:
    `(S1 (
   for) + S2 (for) + S3 (for) – S1 (against) – S2 (against) – S3 (against) )` ?
 * Thanks!
 *  Thread Starter [punitganshani](https://wordpress.org/support/users/punitganshani/)
 * (@punitganshani)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/statistics-complex-formula/#post-14868781)
 * I have tried that as well.
 * The absolute value is correct
 *     ```
       (S1 (for) + S2 (for) + S3 (for) – S1 (against) – S2 (against) – S3 (against) )
       ```
   
 * but when we apply `>0` to it, the answer is always `0` instead of `0` (false)
   or `1` (true)
 *     ```
       (S1 (for) + S2 (for) + S3 (for) – S1 (against) – S2 (against) – S3 (against) ) > 0
       ```
   
 * Screenshot:
 * > [View post on imgur.com](https://imgur.com/a/fdnPnQE)
 * The Formats I can see in Player Statistics and Team Statistics is `Number` and`
   Time`. Is there a way to enable `Variable` if that will make a difference?
    -  This reply was modified 4 years, 8 months ago by [punitganshani](https://wordpress.org/support/users/punitganshani/).
 *  [Roch](https://wordpress.org/support/users/rochesterj/)
 * (@rochesterj)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/statistics-complex-formula/#post-14882642)
 * Hi there!
 * Thanks for testing!
 * That’s very odd. We usually don’t do this, but can you send us a message in the
   presales channel? I’d like to check your setup if possible.
    support.themeboy.
   com/
 * Thanks!
    -  This reply was modified 4 years, 8 months ago by [Roch](https://wordpress.org/support/users/rochesterj/).

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

The topic ‘Statistics – Complex Formula’ is closed to new replies.

 * ![](https://ps.w.org/sportspress/assets/icon-256x256.png?rev=1252005)
 * [SportsPress - Sports Club & League Manager](https://wordpress.org/plugins/sportspress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sportspress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sportspress/)
 * [Active Topics](https://wordpress.org/support/plugin/sportspress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sportspress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sportspress/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Roch](https://wordpress.org/support/users/rochesterj/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/statistics-complex-formula/#post-14882642)
 * Status: resolved