I often use the [Randbetween()] function to generate a random number between 0 and a number in a cell that changes. Normally Randbetween works just fine for this, but sometimes the number being referenced ends up being a negative number, resulting in the 0 and negative number being out of order, for example "Randbetween(-20,0)". This results in a value error.
The workaround I have found for this is to use this formula where "A1" is the cell being referenced
"RAND()*(0-A1)+A1"
Am I correct in thinking that this is achieving the same result that a "randbetween" would without the need to have the bottom and top values placed correctly within the formula?
If not how else can I achieve this? The only other way i've thought of is
"IF(A1<0, RANDBETWEEN(A1,0),RANDBETWEEN(0,A1))"
but that's very text and command heavy for something that I feel should be fairly simple.
Bookmarks