### Excel RANDBETWEEN Function

##### Associated Files Download Links

In this Article

This Excel Tutorial demonstrates how to use the **Excel RANDBETWEEN Function** in Excel to calculate a random number between two numbers, with formula examples.

## RANDBETWEEN Function Description:

The RANDBETWEEN Function Calculates a random number between two numbers.

## Formula Examples:

Example | Formula | Result |
---|---|---|

1 | =RANDBETWEEN(C5,D5) | 29 |

2 | =RANDBETWEEN(C6,D6) | 61 |

3 | =RANDBETWEEN(C7,D7) | #NUM! |

## Syntax and Arguments:

The Syntax for the RANDBETWEEN Formula is:

1 |
=RANDBETWEEN(bottom,top) |

### Function Arguments ( Inputs ):

**bottom** – The smallest integer that randbetween can return.

**top** – The largest integer that randbetween can return.

## Additional Notes

Use the RANDBETWEEN Function to calculate a random integer between two numbers.

`=rand()`

## RANDBETWEEN Examples in VBA

You can also use the RANDBETWEEN function in VBA. Type:

`Application.Worksheetfunction.Randbetween(bottom,top)`

For the function arguments (bottom, etc.), you can either enter them directly into the function, or define variables to use instead.

Return to the List of all Functions in Excel

## How to use the RANDBETWEEN Function in Excel:

To use the AND Excel Worksheet Function, type the following into a cell:

`=AND(`

After entering it in the cell, notice how the AND formula inputs appear below the cell:

You will need to enter these inputs into the function. The function inputs are covered in more detail in the next section. However, if you ever need more help with the function, after typing “=RANDBETWEEN(” into a cell, without leaving the cell, use the shortcut **CTRL + A** (**A** for **A**rguments) to open the “Insert Function Dialog Box” for detailed instructions:

For more information about the RANDBETWEEN Formula visit the

Microsoft Website.