How to Sort by Color in Google Sheets (Easy Step-by-Step Guide)

How to Sort by Color in Google Sheets (Easy Step-by-Step Guide)
Video sort google sheet by color

Bolamarketing.com – your go-to resource for mastering Google Sheets

Google Sheets constantly introduces exciting new features. In March 2020, they added the ability to sort a set of data based on color. This can be the background color of a cell or the text color.

If you work with colored data, you can now easily sort it to group all the colored cells/rows together.

In this tutorial, I will show you the exact steps to sort by color in Google Sheets.

Sorting by Cell Background Color

Let’s say you have a dataset like the one shown below and you want to sort this data based on color (so that all the yellow cells are grouped at the top).

Dataset with colored rows

Here are the steps to sort by cell color in Google Sheets:

  1. Select a cell in the data (or select the entire data)
  2. Click on the Data option in the menu
  3. In the options that appear, click on Create a filter. This will apply a filter to the first row of the dataset
  4. Click on the filter icon in the header of any column (where the column color is the one you want to sort by)
  5. Hover over the Sort by color option, then hover over the Fill color option. This will show you all the colors used in the dataset
  6. Click on the color you want to sort by. In this example, I clicked on the “light yellow 2” color.

The above steps will instantly sort the data and give you the result as shown below (where all the yellow cells are at the top).

Dataset that has been sorted by color

That’s how you can sort by color in Google Sheets when you have one color (other than the default white).

But what if you have multiple colors in the dataset (as shown below):

Dataset with multiple colors

In this dataset, I want to sort by color, where I have all the green cells at the top, followed by the yellow cells, and finally all the white cells (i.e., those that have no color applied to the background).

Here are the steps to sort by multiple colors in Google Sheets:

  1. Select a cell in the data (or select the entire data)
  2. Click on the Data option in the menu
  3. In the options that appear, click on Create a filter. This will apply a filter to the first row of the dataset
  4. Click on the filter icon in the header of any column (where the column color is the one you want to sort by)
  5. Hover over the Sort by color option, then hover over the Fill color option. This will show you all the colors used in the dataset
  6. Click on the “light yellow 2” color option. This will sort the data so that all the yellow rows are at the top.
  7. Now, click on the filter icon in any header again, hover over the Sort by color option, then Fill color, and then click on the “light green 2” color option.

The above steps will sort the data where the last chosen color option (green in our example) will be at the top of the sorted dataset, followed by the yellow color.

Dataset sorted by multiple colors

Sorting by Text Color (Font Color)

Just like you can sort based on the background color of a cell, Google Sheets also allows you to sort based on the font color.

Let’s say you have the dataset as shown below, where some cells have red-colored text.

Dataset to Sort by font color

Here are the steps to sort this dataset by font color so that all the red-colored font cells are at the top of the dataset:

  1. Select a cell in the data
  2. Click on the Data option in the menu
  3. Click on Create a filter. This will enable filters for the first row of the dataset
  4. Click on the filter icon in the header of any column
  5. Hover over the Sort by color option, then hover over the Fill color option. This will show you all the colors used in the dataset
  6. Choose the color for which you want all the cells to be at the top. In this example, I choose red.

And there you have it!

The above steps will sort the chosen colored cells at the top of the dataset.

Dataset sorted by text color

If you want those cells to be at the bottom, you would choose a different color (black in this example), which will sort and place all the cells with black font color at the top. This also means that those with red color will automatically be at the bottom.

If you have different-colored fonts, you can also sort them. Sort them once by one color, then by the next color. And remember, the color you sort by last will always be at the top of the dataset (after sorting).

How to Undo the Sort and Retrieve the Original Data

In case you need to restore the original sorting order later on, you can easily do so.

The trick is to add an auxiliary column (to the left or right of the dataset) and number it with an increment of 1 (e.g., 1, 2, 3…), as shown below:

Helper column

Now, if you sort the data and for any reason, you need to undo the sort and retrieve the original data, you can sort the data based on the auxiliary column.

Another way to do this is by simply creating a copy of your document. That way, you will have the original data in a separate workbook. You can also use the version history feature in Google Sheets to go back and see how the original data looked before you sorted it by color.

That’s how you can sort by color in Google Sheets (whether it’s the cell background color or the font color).

I hope you found this tutorial helpful!

You can also check out other Google Sheets tutorials on Crawlan.com.

Related posts