Author Topic: Forumla question  (Read 1854 times)

yoursmine

  • Newbie
  • *
  • Posts: 4
    • View Profile
Forumla question
« on: August 10, 2006, 04:56:26 PM »
Thanks for the TD...great program by the way!!
I need a formula and was wondering if anyone can help me with the syntax

For the top 9 players I need a formula that does the following
Rank 1st  Add 350 pts + (# of players X 10 X 35%) + number of hits X 5
I basically want this formula to divide up 1000 pts for the top 9 with first getting 35%
Then the formula needs to takes the number of players multiply that times 10 pts and take 35% for first, 25% for second, etc
Finally the number of hits the player made times 5

So lets assume it was a 35 player tourney
1st would get 350 + 122.5 (35X10X35%) + 40 (assume the player took out 8 players 8X5) for a total of 512.5 pts

My formula which I tried was if(r=1, 350+(n*10*.35)+(nhX5)) keeps giving me an error
What am I missing with this one?
Also I should be able to just do this for spots 1 thru 9 right ?

Thanks in advance

yoursmine

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Forumla question
« Reply #1 on: August 10, 2006, 05:53:18 PM »
Ok so I got it sort of working...here it is

if (r=1, 350+(n*10*.35)+(nh*5),if (r=2, 200+(n*10*.20)+(nh*5),if (r=3, 150+(n*10*.15)+(nh*5)
,if(r=4, (100+(n*10*.10)+(nh*5),if (r=5, (80+(n*10*.08)+(nh*5))))))))

It works fine when there are only 4 entries but when I add the 5th argument (if (r=5...etc) then the values of 4th and 5th return 0. If I remove the 5th argument it works fine and returns the correct totals

Can it only accept 4 arguments or what?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5575
    • View Profile
Re: Forumla question
« Reply #2 on: August 10, 2006, 09:56:50 PM »
[yoursmine emailed this question to me; I'm copying my response here for the benefit of anyone else curious]

First, let's re-format your formula, to make it easier to read, like this:

if (r=1, 350+(n*10*.35)+(nh*5),
if (r=2, 200+(n*10*.20)+(nh*5),
if (r=3, 150+(n*10*.15)+(nh*5),
if (r=4, (100+(n*10*.10)+(nh*5)
)
)
)
)
)

Ok, my guess is that when you add your 5th place clause, you're getting some parentheses mismatch, due to that extra left-parenthesis in your 4th place clause.  Now, the formula as written works, but I suspect when you add your 5th place clause, it looks like this:

if (r=1, 350+(n*10*.35)+(nh*5),
if (r=2, 200+(n*10*.20)+(nh*5),
if (r=3, 150+(n*10*.15)+(nh*5),
if (r=4, (100+(n*10*.10)+(nh*5),
if (r=5, 100+(n*10*.08)+(nh*5)))))))

I won't try to detail what exactly that's doing, just tell you how to fix it.  Either remove this parenthesis:

if (r=4, (100+(n*10*.10)+(nh*5),

Or add a matching one:

if (r=4, (100+(n*10*.10)+(nh*5)),


yoursmine

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Forumla question
« Reply #3 on: August 11, 2006, 03:21:39 PM »
Thanks for the followup Corey. It worked like a charm. I now have a second question. I want to make the results of those arguments be the prizes the players receive for placing in the top 9 of my tourney. Is there anyway to use the results of those arguments to configure the prizes in the tournament? For instance lets say my first place finisher gets 540 pts given a tourney of size x with y # of hits. Those numbers could change depending on the size of the tourney and the 3 of hits. Is there any way to configure the prizes so that they reflect the results of the formula? Will I just have figure these numbers out by hand at each tournament and then manually enter the total? Thanks

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5575
    • View Profile
Re: Forumla question
« Reply #4 on: August 11, 2006, 03:34:53 PM »
Well, this begs the question: Why?

A player who in your tournament ranks 1st will ... rank 1st.  And, because of the formula you create, the player will be awarded points.  What in addition are you wanting to do?

yoursmine

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Forumla question
« Reply #5 on: August 11, 2006, 05:51:26 PM »
Well, this begs the question: Why?

A player who in your tournament ranks 1st will ... rank 1st.  And, because of the formula you create, the player will be awarded points.  What in addition are you wanting to do?

Ok
So I run a tournament and I want to purely award points to the players...places 1-9. It would be nice to be able to see the pts "up for grabs" so to speak on the Tournament screen as the players are playing. Its really no different than showing them the monetary prizes available as they are playing. Is this possible to do? If not I have a work around through using an excel worksheet. Thanks