Try for first case:
Copy to next cell for second case.
It is so hard to test, because of value change continously, so you can change the % upto 80 or even 100% to test.
Clarafication:
With 40% in B2, 1 in B1, mean the last 19 number will be 60%.
The total of number now should be : ROUND((COUNT($A$3:$A$22)-1)/(1-B$2)=19/60%=32
with 23 of "1" and 19 of the rest
Now the RANDBETWEEN returns random number between 1 and 32
From 1-20 (occupy 60%): get random number in A3:A22
From 21-32 (occupy 40%): get number "1"
Hope it is clear enough for you.
Bookmarks