abc weighted random

Kishan

Well-known Member
Joined
Mar 15, 2011
Messages
1,648
Office Version
  1. 2010
Platform
  1. Windows
Using Excel 2000

Hi,

I want a "1" random cell to be filled en the each row C6:E12 imagine there are 7
Lottery winning drum...

In the first Lottery winning drum there are 48 balls with letter a, 31 balls with letter b, 21 balls with letter c total 100 in the C6:E6.
So it is possible the random take in account the weight of filled balls a, b, c and fill the cell accordingly or it has to be normal random selections

And in the rest Lottery winning drum C7:E12 will be applied the same method.

So far 7 random selected cells will be highlighted in the range C6:E12

Balls WithBalls WithBalls With
Letter aLetter bLetter c
483121
711811
403030
562618
741610
273439
343333



Please I need some "Formula or VBA" solution for my this problem

Thank you in advance

Regards,
Kishan
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
HI,

Is the following what you need?
Book5
ABCD
1Balls WithBalls WithBalls WithRandom choice
2Letter aLetter bLetter c
3483121a
4711811a
5403030c
6562618a
7741610a
8273439b
9343333a
Sheet1
Cell Formulas
RangeFormula
D3:D9D3=MID(REPT("a",A3)&REPT("b",B3)&REPT("c",C3),RANDBETWEEN(1,SUM(A3:C3)),1)
 
Upvote 0
Solution
J.Ty., yes that is what I wanted, but it is giving a result in the column "D", instead is it possible to highlight the 1 cell in each row and total 7 in the range A3:C9?

Thank you for help

Kind Regards
Kishan:)
 
Upvote 0
The second attempt still uses column D, but you can hide it or transfer the cells to some other location.
Book5
ABCD
1Balls WithBalls WithBalls WithRandom choice
2Letter aLetter bLetter c
3483121a
4711811a
5403030b
6562618a
7741610a
8273439a
9343333c
Sheet1
Cell Formulas
RangeFormula
D3:D9D3=MID(REPT("a",A3)&REPT("b",B3)&REPT("c",C3),RANDBETWEEN(1,SUM(A3:C3)),1)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:C9Expression=RIGHT(A$2;1)=$D3textNO
 
Upvote 0
J.Ty., yes your conditional formatting did a trick, as I am using older version I changed the row 2 with only a, b and c, than applied the formula =SI($D3=A$2;1;0) and all worked fine.

Thank you very much for your help

Kind Regards
Kishan :)
 
Upvote 0
Thanks for the feedback and good luck!
 
Upvote 0
BTW, if you want to help us help you, please edit your profile and indicate there the Excel version you are using. It is in the "Account details" section.
 
Upvote 0
@J.Ty.
There isn't an option for Xl 2000, the earliest version in the list 2007.
Also Kishan always puts his Xl version in his op ;)
 
Upvote 0
@J.Ty.
There isn't an option for Xl 2000, the earliest version in the list 2007.
Also Kishan always puts his Xl version in his op ;)
Indeed, I have overlooked it. Sorry Kishan.
 
Upvote 0
@J.Ty.
There isn't an option for Xl 2000, the earliest version in the list 2007.
Also Kishan always puts his Xl version in his op ;)
Thank you Fluff, for your reply to J.Ty. much kind of you

Kind Regards
Kishan :)
 
Upvote 0

Forum statistics

Threads
1,215,006
Messages
6,122,665
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top