Generating a random number x times

managerimankeli

New Member
Joined
Sep 13, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I need the RAND function to generate numbers x amount of times and sum them, where x is defined by the value of another cell. I tried this using the formula:
=A1*RANDBETWEEN(1;4)

The problem is that this generates one number only and then multiplies it, as opposed to generating many numbers and summing them. For example, if A1=3, I would want results ranging from 3-12, but the formula actually returns 3, 6, 9 or 12. How would I make the RANDBETWEEN function actually run A1 times?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi & welcome to MrExcel.
How about
Fluff.xlsm
AB
1320
Data
Cell Formulas
RangeFormula
B1B1=SUM(RANDARRAY(A1,,1,12,1))
 
Upvote 0
Solution
...a minor tweak: change the 1st 1 to a 3 for values between 3 and 12
edit: sorry...did I misinterpret the objective? A1 is the number of rows (the number of random numbers to generate). The next two numbers establish the lower and upper limits of those numbers. The last 1 means to generate integers. Do you want numbers between 1-12 or 3-12?
 
Last edited:
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top