Title: Formula Error
Last modified: August 21, 2016

---

# Formula Error

 *  Resolved [tiger2deuce](https://wordpress.org/support/users/tiger2deuce/)
 * (@tiger2deuce)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/formula-error/)
 * Good morning, I am trying to fix an error that I am receiving from a formula 
   within my tables. It is “!ERROR! division by zero.” I currently have the following
   formula =number_format((C13+G13*.5))/(C13+E13+G13),3) in the W% column ([http://www.d2softball.com/gsc-standings/](http://www.d2softball.com/gsc-standings/)).
   I would like for it to show 0.000 when I have 0-0-0 in the cells. Could you help
   me out with this? I’ve been trying if/then statements but just cannot seem to
   get it to work out.
 * Thanks!
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

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

 *  [RossMitchell](https://wordpress.org/support/users/rossmitchell/)
 * (@rossmitchell)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/formula-error/#post-5123837)
 * Thankyou for presenting all the relevant info, wish more people did that.
 * Will this do the trick:
    number_format((C13+G13*.5))/(C13+E13+G13+0.000001),3)
   The error this introduces will not be significant. There will have to be an equation
   using “if”, but I am not sufficiently familiar with this plugin. Thankyou for
   drawing this plugin to my attention.
 *  Thread Starter [tiger2deuce](https://wordpress.org/support/users/tiger2deuce/)
 * (@tiger2deuce)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/formula-error/#post-5123852)
 * I kept the = sign in front of the equation and just added 0.000001 at the end
   like you showed above and it worked perfectly. Thank you for your help! Glad 
   you found the plugin. It is awesome and Tobias (the developer) is most helpful!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/formula-error/#post-5123995)
 * Hi,
 * thanks for your question, and sorry for the trouble.
 * Thanks for that suggestion, RossMitchell! “Cheating” with a very small number
   is a nice trick here.
    The solution with an “IF” check should look like this:
 *     ```
       =NUMBER_FORMAT( IF( C13+E13+G13 = 0, 0.000, (C13+G13*.5))/(C13+E13+G13) ) , 3 )
       ```
   
 * (You’d basically just check if the denominator is 0. If so, return the fallback
   value, if not, calculate the division.)
 * Regards,
    Tobias

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

The topic ‘Formula Error’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/formula-error/#post-5123995)
 * Status: resolved