How to Use the COINFLIP Function in Google Sheets

This guide will explain how to use the COINFLIP function in Google Sheets.

A coin flip or coin toss is a classic method to use when you need to make a random decision. This method involves tossing a coin and performing a certain action depending on whether the coin lands with the heads or tails face-up.

Google Sheets includes a COINFLIP function that allows you to return either TRUE of FALSE in a specific cell. However, since the COINFLIP function is currently undocumented, the RANDBETWEEN function is a safer alternative when you need to simulate a coin flip in Google Sheets.

In this guide, we will provide a step-by-step tutorial on how to simulate a coin flip using both COINFLIP and RANDBETWEEN.

The Anatomy of the COINFLIP Function

The syntax of the COINFLIP function is as follows:

=COINFLIP()

Let’s look at each argument to understand how to use the COINFLIP function.

  • = the equal sign is how we start any function in Google Sheets.
  • COINFLIP() refers to our COINFLIP function. This function randomly returns either a TRUE or FALSE.
  • The function requires no arguments from the user.
  • The COINFLIP function re-evaluates every time the user opens the sheet or if the user makes changes to the sheet.

The Anatomy of the RANDBETWEEN Function

The syntax of the RANDBETWEEN function is as follows:

=RANDBETWEEN(low, high)

Let’s look at each argument to understand how to use the RANDBETWEEN function in Google Sheets.

  • = the equal sign is how we start any function in Google Sheets.
  • RANDBETWEEN() refers to our RANDBETWEEN function. This function allows us to select a random number given the low end and high end of a specific range.
  • The low argument should be a numerical value which refers to the low end of the numerical range.
  • The high argument should be a numerical value referring to the high end of the numerical range.
  • If the low or high argument contains decimal parts, the argument will be rounded down (low) or rounded up (high) when calculating the range.

A Real Example of Performing a Coin Flip in Google Sheets

Using the COINFLIP Function

Let’s explore a simple example where we can use the COINFLIP function in Google Sheets to simulate a coin flip.

Suppose you have to schedule multiple presenting groups into two batches: morning and afternoon. To make it fair for all groups, you want to use a coin flip for each group to decide whether they present in the morning or in the afternoon.

In the table above, we have a table containing a list of groups and a column that determines whether the group will present their pitch in the morning or afternoon.

To do this, we can use the following formula:

=IF(COINFLIP(),”MORNING”,”AFTERNOON”)

The COINFLIP function will return either TRUE or FALSE. The IF function will return “MORNING” if the COINFLIP returns TRUE and “AFTERNOON if it returns False.

In our example above, our IF function returns AFTERNOON since our coin flip randomly chose to return FALSE.

We can then use the fill handle to copy the formula down the rest of the column. Note that we should copy these values since the formulas will re-evaluate when making changes to the sheet.

Using the RANDBETWEEN Function

We can also use the RANDBETWEEN function to simulate a coin flip in Google Sheets.

We can adjust the formula from earlier to use the RANDBETWEEN function:

=IF(RANDBETWEEN(0,1),"MORNING","AFTERNOON")

The RANDBETWEEN function above returns 0 or 1 rather than TRUE or FALSE. However, the IF function considers 0 and 1 as FALSE and TRUE, respectively. 

In our example above, we were able to perform a coin flip for each group using RANDBETWEEN.

Click on the link below to create your own copy of our examples.

Head to the next section to read our step-by-step tutorial on how to start using the COINFLIP and RANDBETWEEN functions in Google Sheets.

How to Use COINFLIP Function in Google Sheets

  1. Let’s start with simulating a coin flip with the COINFLIP function. First, select an empty cell where you wish to output the result of the COINFLIP function.

    In this example, we’ll enter our function in cell B2.
  2. Type the IF function and enter COINFLIP() as the first argument.

    For the second argument, type the value you want to return if COINFLIP returns TRUE. For the third argument, enter the value you want to return if COINFLIP returns FALSE.
    Hit the Enter key to evaluate the formula.
  1. Use the Fill Handle tool to copy the formula down the rest of the column.

    In our example above, we were able to randomly return either “MORNING” or “AFTERNOON” based on the output of the COINFLIP function.
  2. We can use the RANDBETWEEN function instead to simulate our coin flip. Simply replace COINFLIP() with RANDBETWEEN(0,1) in our formula.

That’s all the steps you need to know to simulate a coin toss in Google Sheets

To learn more about random values in Google Sheets, you can read our post on how to generate random numbers in Google Sheets.

That’s all for this guide! Don’t forget to check out our library of spreadsheet resources, tips, and tricks for both Google Sheets and Microsoft Excel! 

Get emails from us about Excel.

Our goal this year is to create lots of rich, bite-sized tutorials for Excel users like you. If you liked this one, you'd love what we are working on! Readers receive early access to new content.

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like