---
title: "RAND function in Excel: syntax and examples | PracticeExcel"
description: "How to use RAND in Excel and Google Sheets: random decimals, random numbers in a range, and how to stop them from changing."
canonical_url: "https://practiceexcelonline.com/functions/rand"
locale: en
meta:
  "og:description": "How to use RAND in Excel and Google Sheets: random decimals, random numbers in a range, and how to stop them from changing."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UkFORCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBSQU5EIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByYW5kb20gZGVjaW1hbHMsIHJhbmRvbSBudW1iZXJzIGluIGEgcmFuZ2UsIGFuZCBob3cgdG8gc3RvcCB0aGVtIGZyb20gY2hhbmdpbmcu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_RAND()%2Cp_Ii9mdW5jdGlvbnMvcmFuZCI%2Cs_lJfNm2LOP5p9_X85.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "RAND function in Excel: syntax and examples | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UkFORCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBSQU5EIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByYW5kb20gZGVjaW1hbHMsIHJhbmRvbSBudW1iZXJzIGluIGEgcmFuZ2UsIGFuZCBob3cgdG8gc3RvcCB0aGVtIGZyb20gY2hhbmdpbmcu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_RAND()%2Cp_Ii9mdW5jdGlvbnMvcmFuZCI%2Cs_lJfNm2LOP5p9_X85.png"
---

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

# **The RAND function**

Returns a random decimal number from 0 up to, but not including, 1. It changes every time the sheet recalculates.

=

RAND(

## **Syntax**

```
RAND()
```

<dl></dl>

## **Examples**

B1=AND(RAND()>=0,RAND()<1)

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

B1=AND(RAND()\*50+50>=50,RAND()\*50+50<100)

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

B1=ISNUMBER(RAND())

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

## **Questions**

<details>

<summary>

### How do I stop RAND from changing every time?

</summary>

Copy the cells, then paste them back with Paste Special &gt; Values (Ctrl+Alt+V, V, Enter). The formulas become fixed numbers.

</details>

<details>

<summary>

### How do I get a random number between two values?

</summary>

For decimals, use =RAND()\*(top-bottom)+bottom, so =RAND()\*50+50 gives a number from 50 up to 100. For whole numbers, RANDBETWEEN is simpler.

</details>

## **Related functions**

- [**RANDBETWEEN**](https://practiceexcelonline.com/functions/randbetween)
- [**INT**](https://practiceexcelonline.com/functions/int)
- [**ROUND**](https://practiceexcelonline.com/functions/round)

```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/rand#webpage","description":"How to use RAND in Excel and Google Sheets: random decimals, random numbers in a range, and how to stop them from changing.","name":"RAND function in Excel: syntax and examples","url":"https://practiceexcelonline.com/functions/rand","@type":["WebPage","FAQPage"],"breadcrumb":{"@id":"https://practiceexcelonline.com/functions/rand#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"mainEntity":[{"@id":"https://practiceexcelonline.com/functions/rand#/schema/question/1"},{"@id":"https://practiceexcelonline.com/functions/rand#/schema/question/2"}],"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/functions/rand"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/functions/rand#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":"RAND function in Excel: syntax and examples","position":3}]},{"@id":"https://practiceexcelonline.com/functions/rand#article","description":"How to use RAND in Excel and Google Sheets: random decimals, random numbers in a range, and how to stop them from changing.","headline":"RAND function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UkFORCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBSQU5EIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByYW5kb20gZGVjaW1hbHMsIHJhbmRvbSBudW1iZXJzIGluIGEgcmFuZ2UsIGFuZCBob3cgdG8gc3RvcCB0aGVtIGZyb20gY2hhbmdpbmcu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_RAND()%2Cp_Ii9mdW5jdGlvbnMvcmFuZCI%2Cs_lJfNm2LOP5p9_X85.png","@type":["Article","TechArticle"],"author":{"@id":"https://practiceexcelonline.com/#identity"},"image":{"@id":"https://practiceexcelonline.com/#/schema/image/1"},"isPartOf":{"@id":"https://practiceexcelonline.com/functions/rand#webpage"},"mainEntityOfPage":{"@id":"https://practiceexcelonline.com/functions/rand#webpage"},"publisher":{"@id":"https://practiceexcelonline.com/#identity"}},{"@id":"https://practiceexcelonline.com/functions/rand#/schema/question/1","@type":"Question","inLanguage":"en-US","name":"How do I stop RAND from changing every time?","acceptedAnswer":{"@type":"Answer","text":"Copy the cells, then paste them back with Paste Special > Values (Ctrl+Alt+V, V, Enter). The formulas become fixed numbers."}},{"@id":"https://practiceexcelonline.com/functions/rand#/schema/question/2","@type":"Question","inLanguage":"en-US","name":"How do I get a random number between two values?","acceptedAnswer":{"@type":"Answer","text":"For decimals, use =RAND()*(top-bottom)+bottom, so =RAND()*50+50 gives a number from 50 up to 100. For whole numbers, RANDBETWEEN is simpler."}},{"@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_~UkFORCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBSQU5EIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByYW5kb20gZGVjaW1hbHMsIHJhbmRvbSBudW1iZXJzIGluIGEgcmFuZ2UsIGFuZCBob3cgdG8gc3RvcCB0aGVtIGZyb20gY2hhbmdpbmcu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_RAND()%2Cp_Ii9mdW5jdGlvbnMvcmFuZCI%2Cs_lJfNm2LOP5p9_X85.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~UkFORCBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBSQU5EIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByYW5kb20gZGVjaW1hbHMsIHJhbmRvbSBudW1iZXJzIGluIGEgcmFuZ2UsIGFuZCBob3cgdG8gc3RvcCB0aGVtIGZyb20gY2hhbmdpbmcu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_RAND()%2Cp_Ii9mdW5jdGlvbnMvcmFuZCI%2Cs_lJfNm2LOP5p9_X85.png"}]}
```

## Sitemap

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