James Raitsev
James Raitsev

Reputation: 96491

How to generate random Double numbers in Google Sheets within range?

I am looking to generate a list of 50 numbers between -.15 to +.15 in Google Sheets

Both rand(), randarray() seem to offer positive numbers only. I hacked my way around n via a conditional =if(F5>=0.5,1,-1), but this seems grossly inelegant.

Is there a better, cleaner way to create a list of positive and negative numbers within a given range? Wish =RANDBETWEEN(-0.15,0.15) would work

Any ideas?

Upvotes: 1

Views: 586

Answers (1)

Mike Steelson
Mike Steelson

Reputation: 15328

May be

=RAND()*0.3-0.15

so that you will have numbers between -0.15 and +0.15. Or to avoid decimals after .01

=round(RAND()*0.3-0.15,2)

Upvotes: 1

Related Questions