### Excel RANDBETWEEN Function

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:

### Function Arguments ( Inputs ):

bottom – The smallest integer that randbetween can return.

top – The largest integer that randbetween can return.

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.

Executing the following VBA statements

will produce the following results The third statement will raise an error, as RANDBETWEEN will not accept negative numbers as parameters: `=AND(`  