Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 382
  • Last Modified:

Excel random number (based on another cell)

Experts:

I need assistance with deriving a random number which range is determined by the value of another cell.

Usually, for a random number generation, I may chose the following formula:
=RANDBETWEEN(1,20)

... which, as you know, generates any number between 1 and 20.

Now, here's what I need to achieve instead.   Based on another cell value, derive a random number that is within a 30% range (up or down).   For example, let's say I have the following values in the below cell range:

Cell A1 = 10
Cell B1 = random number should be between 7 or 13 (30% of 10 = 3... thus, 10 - 3 or 10 + 3)

Cell A2 = 90
Cell B2 = random number should be between 63 and 117 (30% of 90 = 27... up or down)

Does anyone know how to generate the random number function for this concept?

Thanks,
EEH
0
ExpExchHelp
Asked:
ExpExchHelp
  • 3
  • 3
1 Solution
 
regmigrantCommented:
The obvious answer is
=randbetween(B1*.3,B1*.7) assuming your target number is in B1

are you looking for something more complex?

Reg
0
 
Saqib Husain, SyedEngineerCommented:
=RANDBETWEEN(A1-0.3*A1,A1+0.3*A1)
0
 
regmigrantCommented:
oops, what he said

Reg
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
ExpExchHelpAuthor Commented:
PERFECT!!!!   Thanks for the quick response!
0
 
Saqib Husain, SyedEngineerCommented:
I really think that points should have been awarded to Reg as his solution came in first and is more simplified. I did not see his solution when I posted.
0
 
regmigrantCommented:
Thanks Ssaqibh, but your solution was more accurate
0
 
Saqib Husain, SyedEngineerCommented:
Ahh I see.

I had followed up with

=RANDBETWEEN(0.7*A1,1.3*A1)

but deleted that comment thinking that it was the same as yours.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now