How to Use RAND and RANDBETWEEN in Excel for Mac 2021
Question details
The user wants to know if the RAND and RANDBETWEEN functions are supported in Excel for Mac 2021 and 2019, and how to access them.

- Product
- Excel for Mac
- Device & OS
- Mac
- Scenario
- Generating random numbers in a worksheet without requiring specialized add-ins.
- Observed behavior
- The user is uncertain if these functions are standard features or part of the Analysis ToolPak, and needs to know what to do if the functions are not recognized by the application.
Verify that your version of Excel for Mac is properly activated, as RAND and RANDBETWEEN are standard built-in functions that do not require any additional add-ins.
Enter the Function Directly into a Worksheet Cell
Since RAND and RANDBETWEEN are standard worksheet functions in Excel for Mac 2019 and 2021, they can be used immediately without enabling the Analysis ToolPak or Solver add-in.
These functions generate random numbers that will automatically recalculate every time the worksheet is changed or opened.
Click on any empty cell in your active Excel worksheet where you want the random number to appear.
To generate a random decimal between 0 and 1, type =RAND(). To generate a random whole number within a specific range, type =RANDBETWEEN(1,100) replacing 1 and 100 with your desired minimum and maximum values.
Press the Return key on your Mac keyboard to execute the formula. The cell will now display a randomly generated number.

Troubleshoot Unrecognized Functions
If Excel returns a #NAME? error or fails to recognize the RANDBETWEEN function, your installation might be corrupted or outdated.
Generate Random Numbers Seamlessly in WPS Office
WPS Office Spreadsheet provides complete, native support for standard functions like RAND and RANDBETWEEN. You can easily generate random numbers using the exact same formulas as Microsoft Excel, completely free of charge.
- 1. Open a new spreadsheet: Launch WPS Office and click on 'Spreadsheet' to create a new blank workbook.
- 2. Select a cell and enter the formula: Click on any empty cell and type =RANDBETWEEN(10, 50) directly into the cell or the formula bar.
- 3. Press Enter to execute: Press Enter on your keyboard. WPS Spreadsheet will instantly calculate and display a random number between your chosen boundaries.
- 4. Lock the generated numbers (Optional): If you don't want the numbers to change, copy the cell (Ctrl+C / Cmd+C), right-click, and select 'Paste as Values' to freeze the output.

Frequently Asked Questions
Do I need to enable the Analysis ToolPak to use RANDBETWEEN?
No. RAND and RANDBETWEEN are standard, built-in functions in Excel for Mac. They are not part of the Analysis ToolPak or the Solver add-ins, so no extra steps are required to enable them.
Can I upgrade from Excel for Mac 2019 to 2021 for free?
No. Excel for Mac 2019 and Excel for Mac 2021 are separate perpetual licenses. Upgrading from the 2019 version to the 2021 version requires a new, separate purchase.
Why do my random numbers keep changing when I edit the sheet?
RAND and RANDBETWEEN are volatile functions, meaning they recalculate every time any change is made to the worksheet. To stop them from changing, copy the cells containing the formulas and use 'Paste Special > Values' to overwrite the formulas with static numbers.
What should I do if Excel shows a #NAME? error for RANDBETWEEN?
A #NAME? error typically means there is a typo in the function name. Verify that you spelled RANDBETWEEN correctly. If the spelling is correct and the issue persists, try updating or reinstalling your Excel for Mac application.




