Weird request - Excel formula (1 Viewer)

Mesnik44

3 of a Kind
Supporter
Joined
Nov 7, 2014
Messages
653
Reaction score
1,035
Location
Port Coquitlam, B.C.
Hi,

I'm in need a formula that will break out any number into a stack of chips. The excel just doesn't flow through me :(

If I enter 5125, I would like the formula to break out 5x1000, 1x100 and 1x25.

If any excel gurus are out there, I would really appreciate your formula and help!

Thank you in advance.
 
How about this?

ChangeCalculator.JPG


@bentax1978: Thanks for another Excel function that I didn't know about. (y) :thumbsup:
 
If you want to get "fancy", you can paste this code into the VBA editor and create a custom function. The function allows you to specify the specific denoms you want to use. There's no error checking in there, so just make sure you enter the denoms from high to low.

Public Function breakdown(stack_size, ParamArray denoms())

For Each denom In denoms
chips = Int(stack_size / denom)
stack_size = stack_size Mod denom
breakdown = breakdown & chips & "x" & denom & " "
Next denom

If stack_size = 0 Then
breakdown = Trim(breakdown)
Else
breakdown = breakdown & "(" & stack_size & ")"
End If

End Function



Here are some examples of the output:

ex1.png


ex2.png


ex3.png


ex4.png
 
Last edited:
I want to thank everyone that replied.

The reason I wanted this, was for my multi-life games at my Christmas tournament. We play 3 games, and after each game you add up your chips to create a bonus pool for the main event.
I needed a way to quickly create the bonus stack at the end of the multi-life games. This is it. It will save me a lot of time, and I appreciate everything that you all have done.


upload_2017-12-12_11-40-21.png
 
If I enter 5125, I would like the formula to break out 5x1000, 1x100 and 1x25.
System.out.println("1k: " + (x/1000) + ", 100: " + (y/100) + ", 25: " + (z/25));
=INT(A1/1000) & "x1000, " & INT(MOD(A1,1000)/100) & "x100, " & INT(MOD(INT(MOD(A1,1000)),100)/25) & "x25"
How about this?
changecalculator-jpg.139477
examples of the output:
ex4-png.139491

Y U NO LUV 500? :(

Bigots. :p
 
I want to thank everyone that replied.

The reason I wanted this, was for my multi-life games at my Christmas tournament. We play 3 games, and after each game you add up your chips to create a bonus pool for the main event.
I needed a way to quickly create the bonus stack at the end of the multi-life games. This is it. It will save me a lot of time, and I appreciate everything that you all have done.


View attachment 139513

It seems to me you could run into serious change-making issues like that. If a player gets exactly T5000, they start with 1 stupid chip, and thus need change from blind one - and it might not even be available from any player!

Best to write the formula to give ample lower denoms (10-12) per player, and only go to the big chips as necessary to keep smaller denoms reasonable.
 
It seems to me you could run into serious change-making issues like that. If a player gets exactly T5000, they start with 1 stupid chip, and thus need change from blind one - and it might not even be available from any player!

Best to write the formula to give ample lower denoms (10-12) per player, and only go to the big chips as necessary to keep smaller denoms reasonable.


Lower denoms are in the Main Event Stacks
upload_2017-12-12_12-51-48.png


These are the chips earned from buying in early
upload_2017-12-12_12-51-29.png


So, the less chips added later on the better.
 

Attachments

  • upload_2017-12-12_12-50-38.png
    upload_2017-12-12_12-50-38.png
    20.6 KB · Views: 71
Oops, you wanted to know how to calculate starting stacks given the total? Looks like I solved the wrong problem.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account and join our community. It's easy!

Log in

Already have an account? Log in here.

Back
Top Bottom