Samgraphics
Board Regular
- Joined
- Jan 9, 2022
- Messages
- 52
- Office Version
- 2011
- Platform
- MacOS
Hi, can someone please help me? I'm using this formula to select a random number between a range,
=CHOOSE(RANDBETWEEN(1,4),RANDBETWEEN(18,19),22,25,RANDBETWEEN(30,31)) but i would like it to check to see if the number is the same or a repeat and change it to the next number in the range. here is a snippet
So basically if AF is the same as AG or AH or AI or AJ or vise versa, AG is the same as AF,AH,AI, AJ and so on it will choose the next or a different random number in the range of numbers.
I tried this formula
=CHOOSE(RANDBETWEEN(1,4),1,RANDBETWEEN(2,3),4,7)+COUNTIF(O2,P2)+1
but I don't think it's giving me the correct results.
Thank you for your time and help.
=CHOOSE(RANDBETWEEN(1,4),RANDBETWEEN(18,19),22,25,RANDBETWEEN(30,31)) but i would like it to check to see if the number is the same or a repeat and change it to the next number in the range. here is a snippet
STATISTICAL NUMBER GENERATOR BY column 2022.xlsx | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
O | P | Q | R | S | T | U | V | AF | AG | AH | AI | AJ | AK | AL | ||||||||||||
2 | 3 | 0 | 0 | 0 | 0 | 1 | 0 | 5 | 9 | 27 | 30 | 34 | 5 | 11 | ||||||||||||
3 | 2 | 1 | 0 | 0 | 0 | 1 | 0 | 3 | 5 | 10 | 30 | 24 | 5 | 11 | ||||||||||||
4 | 2 | 0 | 0 | 0 | 0 | 3 | 0 | 5 | 5 | 15 | 31 | 35 | 5 | 12 | ||||||||||||
5 | 3 | 1 | 0 | 0 | 0 | 1 | 1 | 5 | 5 | 15 | 18 | 28 | 3 | 9 | ||||||||||||
6 | 1 | 3 | 0 | 0 | 0 | 4 | 0 | 5 | 5 | 27 | 22 | 24 | 3 | 12 | ||||||||||||
7 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 2 | 5 | 27 | 25 | 20 | 7 | 12 | ||||||||||||
8 | 1 | 0 | 2 | 0 | 0 | 2 | 1 | 8 | 13 | 27 | 19 | 32 | 3 | 12 | ||||||||||||
9 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 4 | 9 | 27 | 31 | 28 | 3 | 11 | ||||||||||||
10 | 0 | 1 | 0 | 1 | 0 | 0 | 2 | 2 | 13 | 10 | 25 | 26 | 7 | 9 | ||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
O2:O10 | O2 | =COUNTIF($C$2:$C$15,M2) |
P2:P10 | P2 | =COUNTIF($D$2:$D$15,M2) |
Q2:Q10 | Q2 | =COUNTIF($E$2:$E$15,M2) |
R2:R10 | R2 | =COUNTIF($F$2:$F$15,M2) |
S2:S10 | S2 | =COUNTIF($G$2:$G$15,M2) |
T2:T10 | T2 | =COUNTIF($H$2:$H$15,K2) |
U2:U10 | U2 | =COUNTIF($I$2:$I$15,K2) |
AF2:AF10 | AF2 | =CHOOSE(RANDBETWEEN(1,4),1,RANDBETWEEN(2,3),4,7)+COUNTIF(O2,P2)+1 |
AG2:AG10 | AG2 | =CHOOSE(RANDBETWEEN(1,3),5,9,13) |
AH2:AH10 | AH2 | =CHOOSE(RANDBETWEEN(1,5),10,12,15,17,27) |
AI2:AI10 | AI2 | =CHOOSE(RANDBETWEEN(1,4),RANDBETWEEN(18,19),22,25,RANDBETWEEN(30,31)) |
AJ2:AJ10 | AJ2 | =CHOOSE(RANDBETWEEN(1,5),20,24,26,RANDBETWEEN(28,29),RANDBETWEEN(32,35)) |
AK2:AK10 | AK2 | =CHOOSE(RANDBETWEEN(1,3),3,5,7) |
AL2:AL10 | AL2 | =CHOOSE(RANDBETWEEN(1,2),RANDBETWEEN(9,10),RANDBETWEEN(11,12)) |
So basically if AF is the same as AG or AH or AI or AJ or vise versa, AG is the same as AF,AH,AI, AJ and so on it will choose the next or a different random number in the range of numbers.
I tried this formula
=CHOOSE(RANDBETWEEN(1,4),1,RANDBETWEEN(2,3),4,7)+COUNTIF(O2,P2)+1
but I don't think it's giving me the correct results.
Thank you for your time and help.