![]() |
using randombetween to arrive at dollars and cents
I'm trying to get a series of random monetary numbers that are between $0.01
and $99.99. Using "=randombetween(.01,99.99)" seems to only give the dollars and makes no cents (pun intended). The only way I've figured to do this is by using the formula "=RANDBETWEEN(1,99)/100+RANDBETWEEN(1,99)". Is there a more elegant way? |
using randombetween to arrive at dollars and cents
Try this:
=ROUND(RAND()*(99.99-0.01)+0.01,2) -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Bob Arnett" wrote in message ... I'm trying to get a series of random monetary numbers that are between $0.01 and $99.99. Using "=randombetween(.01,99.99)" seems to only give the dollars and makes no cents (pun intended). The only way I've figured to do this is by using the formula "=RANDBETWEEN(1,99)/100+RANDBETWEEN(1,99)". Is there a more elegant way? |
using randombetween to arrive at dollars and cents
numbers that are between $0.01 and $99.99.
"=RANDBETWEEN(1,99)/100 + RANDBETWEEN(1,99)". I may be wrong, but it appears that your equation gives a minimum value of 1 +.01 (=1.01) vs your stated 0.01. How about a slight change to your equation? =RANDBETWEEN(1,9999)/100 = = = = HTH :) Dana DeLouis Bob Arnett wrote: I'm trying to get a series of random monetary numbers that are between $0.01 and $99.99. Using "=randombetween(.01,99.99)" seems to only give the dollars and makes no cents (pun intended). The only way I've figured to do this is by using the formula "=RANDBETWEEN(1,99)/100+RANDBETWEEN(1,99)". Is there a more elegant way? |
using randombetween to arrive at dollars and cents
Thanks, both formulas work perfectly but I do prefer the
"=RANDBETWEEN(1,9999)/100". "Dana DeLouis" wrote: numbers that are between $0.01 and $99.99. "=RANDBETWEEN(1,99)/100 + RANDBETWEEN(1,99)". I may be wrong, but it appears that your equation gives a minimum value of 1 +.01 (=1.01) vs your stated 0.01. How about a slight change to your equation? =RANDBETWEEN(1,9999)/100 = = = = HTH :) Dana DeLouis Bob Arnett wrote: I'm trying to get a series of random monetary numbers that are between $0.01 and $99.99. Using "=randombetween(.01,99.99)" seems to only give the dollars and makes no cents (pun intended). The only way I've figured to do this is by using the formula "=RANDBETWEEN(1,99)/100+RANDBETWEEN(1,99)". Is there a more elegant way? |
All times are GMT +1. The time now is 04:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com