---
title: "RANDBETWEEN function in Excel: syntax and examples | PracticeExcel"
description: "How to use RANDBETWEEN in Excel and Google Sheets: random whole numbers, dice rolls and picking a random name from a list."
canonical_url: "https://practiceexcelonline.com/functions/randbetween"
locale: en
meta:
  "og:description": "How to use RANDBETWEEN in Excel and Google Sheets: random whole numbers, dice rolls and picking a random name from a list."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UkFOREJFVFdFRU4gZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSQU5EQkVUV0VFTiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogcmFuZG9tIHdob2xlIG51bWJlcnMsIGRpY2Ugcm9sbHMgYW5kIHBpY2tpbmcgYSByYW5kb20gbmFtZSBmcm9tIGEgbGlzdC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UkFOREJFVFdFRU4oYm90dG9tLCB0b3Ap%2Cp_Ii9mdW5jdGlvbnMvcmFuZGJldHdlZW4i%2Cs_bPYPi62AhgWFKTKM.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "RANDBETWEEN function in Excel: syntax and examples | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UkFOREJFVFdFRU4gZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSQU5EQkVUV0VFTiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogcmFuZG9tIHdob2xlIG51bWJlcnMsIGRpY2Ugcm9sbHMgYW5kIHBpY2tpbmcgYSByYW5kb20gbmFtZSBmcm9tIGEgbGlzdC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UkFOREJFVFdFRU4oYm90dG9tLCB0b3Ap%2Cp_Ii9mdW5jdGlvbnMvcmFuZGJldHdlZW4i%2Cs_bPYPi62AhgWFKTKM.png"
---

> Index of every page on this site: [llms.txt](https://practiceexcelonline.com/llms.txt)

# **The RANDBETWEEN function**

Returns a random whole number between a bottom and a top number, both included. It changes every time the sheet recalculates.

=

RANDBETWEEN(

## **Syntax**

```
RANDBETWEEN(bottom, top)
```

<dl><dt>**bottom **</dt>
<dd>The smallest number it can return.</dd>
<dt>**top **</dt>
<dd>The largest number it can return.</dd></dl>

## **Examples**

B1=AND(RANDBETWEEN(1,6)>=1,RANDBETWEEN(1,6)<=6)

|  | A | B |
| --- | --- | --- |
| 1 |  | **TRUE** |

B1=MOD(RANDBETWEEN(10,99),1)

|  | A | B |
| --- | --- | --- |
| 1 |  | **0** |

C1=ISTEXT(INDEX(A2:A5,RANDBETWEEN(1,4)))

|  | A | B | C |
| --- | --- | --- | --- |
| 1 | Name |  | **TRUE** |
| 2 | Ann |  | |
| 3 | Ben |  | |
| 4 | Cy |  | |
| 5 | Dee |  | |

## **Questions**

<details>

<summary>

### Is the top number included in RANDBETWEEN?

</summary>

Yes. =RANDBETWEEN(1,6) can return 1, 6 and every whole number between them, like a die.

</details>

<details>

<summary>

### How do I pick a random name from a list?

</summary>

Use RANDBETWEEN for the position and INDEX to fetch it, as in =INDEX(A2:A5,RANDBETWEEN(1,4)). Change the 4 when the list grows, or use ROWS(A2:A5).

</details>

## **Related functions**

- [**RAND**](https://practiceexcelonline.com/functions/rand)
- [**INDEX**](https://practiceexcelonline.com/functions/index)
- [**INT**](https://practiceexcelonline.com/functions/int)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://practiceexcelonline.com/#identity","@type":"Organization","name":"PracticeExcel","url":"https://practiceexcelonline.com/","logo":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/#website","@type":"WebSite","inLanguage":"en-US","name":"PracticeExcel","url":"https://practiceexcelonline.com/","alternateName":["Practice Excel Online","PracticeExcelOnline.com"],"publisher":{"@id":"https://practiceexcelonline.com/#identity"},"workTranslation":{"@id":"https://excelopgaver.dk/#website"}},{"@id":"https://practiceexcelonline.com/functions/randbetween#webpage","description":"How to use RANDBETWEEN in Excel and Google Sheets: random whole numbers, dice rolls and picking a random name from a list.","name":"RANDBETWEEN function in Excel: syntax and examples","url":"https://practiceexcelonline.com/functions/randbetween","@type":["WebPage","FAQPage"],"breadcrumb":{"@id":"https://practiceexcelonline.com/functions/randbetween#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"mainEntity":[{"@id":"https://practiceexcelonline.com/functions/randbetween#/schema/question/1"},{"@id":"https://practiceexcelonline.com/functions/randbetween#/schema/question/2"}],"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/functions/randbetween"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/functions/randbetween#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://practiceexcelonline.com","position":1},{"@type":"ListItem","name":"Excel functions","item":"https://practiceexcelonline.com/functions","position":2},{"@type":"ListItem","name":"RANDBETWEEN function in Excel: syntax and examples","position":3}]},{"@id":"https://practiceexcelonline.com/functions/randbetween#article","description":"How to use RANDBETWEEN in Excel and Google Sheets: random whole numbers, dice rolls and picking a random name from a list.","headline":"RANDBETWEEN function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UkFOREJFVFdFRU4gZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSQU5EQkVUV0VFTiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogcmFuZG9tIHdob2xlIG51bWJlcnMsIGRpY2Ugcm9sbHMgYW5kIHBpY2tpbmcgYSByYW5kb20gbmFtZSBmcm9tIGEgbGlzdC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UkFOREJFVFdFRU4oYm90dG9tLCB0b3Ap%2Cp_Ii9mdW5jdGlvbnMvcmFuZGJldHdlZW4i%2Cs_bPYPi62AhgWFKTKM.png","@type":["Article","TechArticle"],"author":{"@id":"https://practiceexcelonline.com/#identity"},"image":{"@id":"https://practiceexcelonline.com/#/schema/image/1"},"isPartOf":{"@id":"https://practiceexcelonline.com/functions/randbetween#webpage"},"mainEntityOfPage":{"@id":"https://practiceexcelonline.com/functions/randbetween#webpage"},"publisher":{"@id":"https://practiceexcelonline.com/#identity"}},{"@id":"https://practiceexcelonline.com/functions/randbetween#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"Is the top number included in RANDBETWEEN?","acceptedAnswer":{"@type":"Answer","text":"Yes. =RANDBETWEEN(1,6) can return 1, 6 and every whole number between them, like a die."}},{"@id":"https://practiceexcelonline.com/functions/randbetween#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"How do I pick a random name from a list?","acceptedAnswer":{"@type":"Answer","text":"Use RANDBETWEEN for the position and INDEX to fetch it, as in =INDEX(A2:A5,RANDBETWEEN(1,4)). Change the 4 when the list grows, or use ROWS(A2:A5)."}},{"@id":"https://practiceexcelonline.com/#logo","@type":"ImageObject","caption":"PracticeExcel","contentUrl":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png"},{"@id":"https://practiceexcelonline.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UkFOREJFVFdFRU4gZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSQU5EQkVUV0VFTiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogcmFuZG9tIHdob2xlIG51bWJlcnMsIGRpY2Ugcm9sbHMgYW5kIHBpY2tpbmcgYSByYW5kb20gbmFtZSBmcm9tIGEgbGlzdC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UkFOREJFVFdFRU4oYm90dG9tLCB0b3Ap%2Cp_Ii9mdW5jdGlvbnMvcmFuZGJldHdlZW4i%2Cs_bPYPi62AhgWFKTKM.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UkFOREJFVFdFRU4gZnVuY3Rpb24gaW4gRXhjZWw6IHN5bnRheCBhbmQgZXhhbXBsZXM%2Cdescription_~SG93IHRvIHVzZSBSQU5EQkVUV0VFTiBpbiBFeGNlbCBhbmQgR29vZ2xlIFNoZWV0czogcmFuZG9tIHdob2xlIG51bWJlcnMsIGRpY2Ugcm9sbHMgYW5kIHBpY2tpbmcgYSByYW5kb20gbmFtZSBmcm9tIGEgbGlzdC4%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~UkFOREJFVFdFRU4oYm90dG9tLCB0b3Ap%2Cp_Ii9mdW5jdGlvbnMvcmFuZGJldHdlZW4i%2Cs_bPYPi62AhgWFKTKM.png"}]}
```

## Sitemap

See the full [sitemap](https://practiceexcelonline.com/sitemap.md) for all pages.
