Solved

Excel random number (based on another cell)

Posted on 2013-12-10
7
284 Views
Last Modified: 2013-12-10
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
Comment
Question by:ExpExchHelp
  • 3
  • 3
7 Comments
 
LVL 19

Expert Comment

by:regmigrant
Comment Utility
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
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
Comment Utility
=RANDBETWEEN(A1-0.3*A1,A1+0.3*A1)
0
 
LVL 19

Expert Comment

by:regmigrant
Comment Utility
oops, what he said

Reg
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Closing Comment

by:ExpExchHelp
Comment Utility
PERFECT!!!!   Thanks for the quick response!
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
Comment Utility
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
 
LVL 19

Expert Comment

by:regmigrant
Comment Utility
Thanks Ssaqibh, but your solution was more accurate
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now