To freeze random numbers in Excel, select the cells containing =RAND() or =RANDBETWEEN(1,100), copy them, then paste their results back as values using Home > Paste > Paste Values. The formulas are replaced by the numbers they currently display, so those numbers no longer change when Excel recalculates. This is useful for keeping a sample, draw, assignment, or randomized list consistent.
The instructions below are for Microsoft Excel for Microsoft 365 on Windows. The same approach works on Mac and Excel for the web, though the ribbon layout and keyboard shortcuts can differ. Save a copy first if the random values are important: replacing formulas with values is easy to do, but undo history can be lost after later workbook changes or closing the file.
What You’ll Need
- An Excel workbook with random-number formulas already entered, or a blank range where you can enter them.
- A clear idea of which cells to keep. If you want to preserve the formulas as well as their current results, plan to paste values into a separate range.
- Optional: a saved copy of the workbook if the formulas would be difficult to recreate.
You do not need to install an add-in or change Excel’s calculation settings. Pasting values is generally safer than switching calculation to Manual: it fixes only the chosen cells and leaves the rest of the workbook calculating normally.
Step-by-Step
- Generate the random numbers. Decide whether you need decimal values or whole numbers. With the random decimal intended for cell B2, enter
=RAND(). It returns a decimal greater than or equal to 0 and less than 1; for example, a displayed result might be 0.6384. With a whole number from 1 through 100 intended for B2, enter=RANDBETWEEN(1,100). Both functions recalculate, so the example results are not guaranteed to stay the same until you freeze them. - Fill the intended range. Enter the formula in the first cell, then use the fill handle at the lower-right corner of that cell to copy it down or across. You can also copy the formula cell, select the destination range, and paste. For example, if the numbers belong in B2:B21, fill the formula through that range. Excel adjusts the cells as needed; RAND and RANDBETWEEN do not need cell references for this simple use.
- Check the selection before copying. Select only the random-number cells you want to keep fixed. If there are labels, totals, or formulas beside them, leave those cells out. For a continuous range, click its first cell and drag to its last, or click the first cell, hold Shift, and click the last. For non-adjacent cells, hold Ctrl while selecting additional ranges on Windows; avoid selecting unrelated cells accidentally.
- Copy the selected cells. Press Ctrl+C on Windows. A moving border appears around the copied range. Do not click into a different cell and type anything before the next step; that could replace the copied selection or change the target. If you want to keep a working copy of the formulas, paste the copied range into a spare area first, then use Paste Values on that duplicate.
- Paste the results as values. Keep the original range selected, then choose Home > Paste > Paste Values. Depending on the ribbon display, Paste Values may appear as a clipboard option marked with “123.” This replaces the formulas in the selected cells with their current displayed results. If you paste to another range instead, click the destination’s top-left cell before choosing Paste Values; the original formulas will remain in place.
- Use a Windows keyboard route if you prefer. After copying, press Ctrl+Alt+V to open Paste Special, choose Values, and press Enter. Another available route in many Microsoft 365 Windows builds is Alt, H, V, V, pressed in sequence, which invokes Paste Values. Ribbon shortcuts can vary with customizations, so use the Paste Values command if a shortcut does not open the expected option.
- Verify that the values are fixed. Click one of the cells and look at the formula bar. It should show a number rather than a formula beginning with an equals sign. Press F9 or make an edit elsewhere in the workbook, then check the cells again. Their values should remain unchanged. If you pasted into a different range, verify the destination and leave or remove the original formulas according to your needs.
- Save the workbook. Save after checking the result. The frozen numbers are now stored as ordinary cell values and will be retained when the workbook is saved, closed, and reopened. Formatting such as number of decimal places may remain, but the underlying random formula will no longer be present in the frozen cells.
On Mac, copy with Command+C, then use Home > Paste > Paste Values, or the Paste Special command and choose Values. Keyboard combinations can differ by Excel for Mac version and keyboard settings, so the ribbon command is the dependable option. In Excel for the web, copy the range and use Home > Paste > Paste Values; if the command is not visible, open the Paste menu. The result is the same: formulas in the target cells are replaced by their current values.
If you want to freeze numbers but retain a record of how they were generated, copy the formula range to another worksheet or workbook before replacing it. You can label the retained formula copy clearly, such as “Original random formulas,” and label the fixed range “Saved draw.” This is especially useful when a random selection needs to be auditable or repeated later.
Common Mistakes
- Copying without pasting values. A regular paste copies the formulas, not just their current results. The new cells can keep changing. Choose Paste Values and verify that the formula bar shows a number.
- Freezing the wrong range. Selecting a header or adjacent calculation can replace useful content. Check the highlighted cells before copying, especially when the data is in a large table.
- Expecting number formatting to freeze a formula. Setting a cell to show two decimal places changes its appearance, not its formula. The underlying RAND result can still change until you replace the formula with its value.
- Changing calculation settings instead. Manual calculation can make formulas appear stable temporarily, but other formulas may also stop updating. It does not turn random formulas into stored values. Use Paste Values when you want a specific range to stay fixed.
- Using Undo much later as the only backup. Undo may no longer be available after additional actions, closing the workbook, or other changes. Keep a separate copy of the formula range or save a backup before making an important set of values final.
Tips
- Choose the right function for the job. RAND is appropriate when you need a decimal from 0 up to but not including 1. RANDBETWEEN is for a whole number between the two supplied limits, including both limits. Once you paste values, either type of result can be sorted, filtered, or used in later calculations like other numbers.
- Keep a reproducible record. If someone may ask how the draw was produced, save a copy of the workbook before freezing, or keep the formulas on a separate sheet. You can also note the date, range, and purpose beside the frozen results.
- Freeze a clean snapshot. If the workbook is undergoing edits, wait until the list and its size are final. Then select the full intended range once and paste values. This avoids a mix of fixed results and formulas that continue to recalculate.
- Preserve formatting deliberately. Paste Values normally replaces cell contents while leaving the destination’s formatting intact when pasting back over the same cells. If pasting elsewhere, set the destination’s number format as needed; number formatting affects display, not whether the values are fixed.
- Remember that freezing is local. Values outside the selected range are unaffected. This lets you keep random formulas in a planning area while using a separate fixed set in a report, provided you paste the results into the intended report cells.
Troubleshooting
The numbers change after I paste. Check a cell in the formula bar. If it still begins with an equals sign, the paste was a normal paste rather than Paste Values. Copy the range again, open the Paste menu, and explicitly choose Values. If you pasted into another location, make sure you are checking the destination rather than the original formula cells.
Paste Values is unavailable or grayed out. Copy the cells first; paste options are enabled only when Excel has copied content. If you are editing a cell, press Esc or Enter to leave edit mode, select the range again, and copy it. In a protected worksheet, editing may be restricted; ask the workbook owner to allow changes or unprotect the sheet if you have permission.
I cannot replace a spilled array of random numbers. A dynamic-array formula can spill results into several cells, and Excel does not allow you to overwrite only part of that spill. Select and copy the full displayed spill range, paste values into a separate empty range, then remove the original formula from its anchor cell if you no longer need it. Confirm that the pasted range contains the full set before deleting anything.
The values changed before I could freeze them. That is expected: random functions can recalculate after edits or other calculation events. Copy the range and paste values as soon as the desired set appears. If a particular draw must be approved, confirm the pasted numbers after the operation and save immediately.
My result has more or fewer decimal places than expected. A cell’s number format may hide digits or display extra zeros. Select the cell and inspect the formula bar or increase decimal places from Home > Number. Formatting changes how a number is shown, not the stored value. After freezing, the stored result remains the same even if you adjust its display format.
The shortcut does something different on my computer. Keyboard mappings differ between Windows, Mac, and some customized ribbon setups. Use the visible Home > Paste > Paste Values command instead. On Mac, use Command+C to copy; then choose Paste Values from the ribbon menu. In the web version, use the Paste menu in the Home tab.
Frequently Asked Questions
Why do random numbers keep changing in Excel?
RAND and RANDBETWEEN are volatile functions: Excel recalculates them during calculation events, so their results can change after edits or recalculation. Replacing the formulas with values keeps the current results.
Does pressing F9 freeze random numbers?
No. F9 recalculates formulas; it does not remove them. The results may change again later. To make them fixed, copy the cells and use Paste Values.
Can I freeze random numbers without losing the formulas?
Yes. Copy the formula range to another location or save a backup first. Then paste values over the range you want to keep fixed. The duplicate formulas remain available separately, although their results can still recalculate.
Will frozen numbers stay fixed after I close and reopen the workbook?
Yes, provided you save the workbook after pasting values. The cells contain ordinary stored numbers rather than RAND or RANDBETWEEN formulas, so recalculation will not replace them.
Can I freeze only some of the random numbers?
Yes. Select only the cells you want to keep, copy them, and paste values over that selection. Any random formulas outside it continue to recalculate normally.
Can I use this for a random draw or sample?
Yes, but save a copy and verify the final range after pasting values. If the selection must be transparent or independently checked, retain the original workbook or document the method and the final fixed results.
Related
- Insert a Personal Signature in Word for Mac: Steps & Tips
- Insert a Personal Signature in Word Online: Steps and Tips
- How to Insert Multiple Tables of Contents in Word
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Google Translate for Google Sheets: Add-on or Formula?You usually do not need a Google Translate add-on for Google Sheets: the built-in GOOGLETRANSLATE function can translate…
- Sort by Due Date in Google Sheets: Step-by-StepTo sort tasks by due date in Google Sheets, select the entire task table, open Data > Sort…
- XLOOKUP in Google Sheets: How It Works and When to Use ItYes. XLOOKUP is a built-in Google Sheets function that searches a row or column for a value and…
- Excel: Calculate the Length of Time Between Two DatesTo find the elapsed number of days between two dates in Excel, subtract the earlier date from the…
- How to Add Color to a Header Row in Microsoft WordTo add color to a header row in Word, select the table’s entire first row, open the contextual…
- Create a Page Break in Excel: Steps and Print TipsTo create a page break in Excel for Microsoft 365 on Windows, select the cell below and to…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.