One quick set-up to try ..
Assume A1:B1 contain the labels: Coins, Value
Input the number of coins in A2, say enter: 4
Put in B2: =SUM(C:C)
Put in C1:
=IF(OR($A$2="",ROWS($A$1:A1)>$A$2),"",RANDBETWEEN(1,6))
Copy C1 down to say, C20, to cover the max expected number (of coins)
that will be input in A2
The above will give you the set-up that you're after.
B2 provides the sum of the random numbers generated in col C, while the
number of cells "activated" in col C will be dependent on the input in A2
Note that RANDBETWEEN requires the Analysis Toolpak
to be installed and activated.
Check the "Analysis Toolpak" box (via Tools > Add-Ins)
Chip Pearson's page has details on the ATP at:
http://www.cpearson.com/excel/ATP.htm
Alternatively, we could replace RANDBETWEEN(1,6) in the formula
with: INT(RAND()*6+1)
(as suggested by Bryan)
i.e. put instead in C1:
=IF(OR($A$2="",ROWS($A$1:A1)>$A$2),"",INT(RAND()*6+1))
and copy down to C20 as before
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"inkpassion" <inkpassion.1utj6b_1125810307.0949@excelforum-nospam.com> wrote
in message news:inkpassion.1utj6b_1125810307.0949@excelforum-nospam.com...
>
> What Im looking to do is have 2 cells 1 with the number of random
> numbers and 2 the total value of these numbers. I need the random
> numbers to be 1-6.
>
> Something like this:
>
> Coins Value
> 4 10
>
> C1 C2 C3 C4
> 1 4 3 2
>
>
> What would the formula be to accomplish this?
>
>
>
> --
> inkpassion
> ------------------------------------------------------------------------
> inkpassion's Profile:
http://www.excelforum.com/member.php...o&userid=16972
> View this thread: http://www.excelforum.com/showthread...hreadid=401757
>
Bookmarks