Function Problems

Make Excel RANDARRAY Values Add Up to a Fixed Total

Steve KSteve K Nov 18, 2026 869 views

Question details

Generate an array of random values that adds up to a predetermined total.

Make Excel RANDARRAY Values Add Up to a Fixed Total
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user wants to use RANDARRAY to distribute a target amount, such as 500, across random values.
Observed behavior
The desired result is an array of random values whose sum equals the target total.
Before you start

Check that your version of Excel supports RANDARRAY, LET, and dynamic arrays. Leave enough empty cells below the formula for the results to spill.

Solution 1Recommended

Normalize a RANDARRAY to the target total

Use LET to generate the random values once, then scale them so their total is 500.

1
Enter the formula

Select an empty cell and enter =LET(values,RANDARRAY(20),total,SUM(values),values/total*500).

2
Check the result

Press Enter to spill 20 values down the column. In another cell, use SUM on the spilled range to check the total.

3
Adjust the inputs

Edit the formula to replace 20 with the number of values you need and 500 with your target. You can also use cell references for these inputs.

Normalize a RANDARRAY to the target total
Recalculation and rounding: RANDARRAY generates new values when Excel recalculates. Floating-point precision can cause tiny differences, and rounding individual values can make their displayed total differ from the target.
Create random allocations in WPS

Create random values with a fixed total in WPS Spreadsheets

Use RAND and SUM in WPS Spreadsheets to generate and scale random values to a target total.

  1. 1. Set the target: Open a worksheet in WPS Spreadsheets and enter 500 in cell B1.
  2. 2. Generate random values: Enter =RAND() in cell A1, then fill the formula down through A20.
  3. 3. Scale the values: Enter =A1/SUM($A$1:$A$20)*$B$1 in C1, then fill the formula down through C20.
  4. 4. Verify the total: Enter =SUM(C1:C20) in an empty cell to check the total. The random values change when the worksheet recalculates.
Scale a column of random values to a target such as 500Open and save Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and a free, easy-to-use interface
microsoft office alternative - wps office

Frequently Asked Questions

Can I use a cell for the target total?

Yes. If the target is in B1, replace 500 in the LET formula with B1. You can also replace 20 with a cell reference containing the desired number of values.

Why do the random values keep changing?

RANDARRAY recalculates when Excel recalculates the worksheet. To keep a set of results, copy the spilled cells and use Paste Special > Values to replace the formulas with their current values.

Why does Excel show a spill error?

The formula needs 20 empty cells in its output column. Clear any content blocking the spill range, then enter the formula again if necessary.

Will rounded values still add up to exactly 500?

Not necessarily. Rounding each result independently can change the displayed sum. If exact rounded totals are required, calculate an adjustment for the rounding difference.