Author Topic: Formula showing as error in test mode  (Read 1190 times)

DCP

  • Newbie
  • *
  • Posts: 15
    • View Profile
Formula showing as error in test mode
« on: October 18, 2015, 10:49:39 PM »
For the life of me, I cannot figure out why my formula is throwing an error in test mode, as it appears to be working properly. The following is my formula. It is loosely based on Dr. Neau's formula with some tinkering. For reference, with a $40 buy-in, $25 rebuy and in a field of 16 it awards the top player 100 points and docks 10 points for a rebuy, and drops off when we have less than 16. It also adds one point for each hit, and rounds up or down to the next 1/2 point. Here is my formula in both Excel format and TD format.

=ROUND((SQRT((A2*B2)*(B2/(B2+(C2*0.375)))/(D2+2))*6.85)/0.5,0)*0.5

ROUND((SQRT((n*bc)*(bc/(bc+(rc*0.375)))/(r+2))*6.85)/0.5,0)*0.5+nh

While it appears to be working properly when calculating during our tournament and I should be happy enough  ;), the testing mode continues to error. Any assistance would be appreciated.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6220
    • View Profile
Re: Formula showing as error in test mode
« Reply #1 on: October 18, 2015, 11:08:52 PM »
When a formula is computed during a tournament, all of the available variables have values directly from the tournament.  For example, n will be equal to the number of participants.

In "test" mode, you have to to provide the value of all of those variables.  You can use the buttons on the Formula dialog to set the variables with values from the current tournament, which is a good idea and I highly recommend doing that.  If you're messing around with a formula, the best thing to do is load a tournament and use it to test your formula.  If the tournament is over, reset it or undo a few bust-outs to get an in-tournament set of values to work with.

Your formula has several divisions.  What is most likely resulting is division by zero.  Division by zero gives a value of "infinity", or, depending on the computer language, an error.  Because you can't really divide something by zero.  Whether the result is an error or "infinity", neither is a value you can work with.

During a tournament, since all of the variables have valid values, your formula won't be performing division with a denominator of zero.  But while testing, it could if you haven't given all of the variables valid values.  Fill in all the values of the variables on the bottom side of the division expressions in your formula and I suspect you won't get an error.