If you have a large Google Sheets dataset, a fun and effective way of grouping and sorting the data is by adding color to individual entries and grouping them based on color. In Google Sheets, you can sort data by fill color or text color; you can do both easily.

You can also filter the data based on text and fill color. But before we get ahead of ourselves, let's learn how to sort data by fill color in Google Sheets.

How to Sort by Fill Color in Google Sheets

There are several ways you can use Google Sheets to make your life easier. And knowing how to sort by color can make the process more fun and effective.

To understand how to sort by fill color, suppose you're looking for an apartment to rent. For reference, you have created the following dataset in Google Sheets:

Dataset

In the dataset, the fill (cell background) color of a few entries is red to signify that you contacted the owners of these apartments for rent, and they rejected your offer.

Now, let's try to make the dataset more manageable by sorting all the red entries together at the bottom. But before we can sort the data by cell color background, we need to enable filtering. Follow the steps given below:

  1. Select any cell from the dataset.
  2. Click the Filter icon (you'll find it on the right side of the menu bar, next to the functions icon).
    Enable Filtering
  3. This will enable sorting and filtering of the complete dataset. You'll also see a filter icon in the headers of all the columns in the dataset.

Now you can easily sort the data by fill color following the steps given below:

  1. Click on the filter icon in any column header (just make sure the column contains the color you want to sort for).
  2. Go to Sort by color > Fill color.
    Sort by color
  3. Select the color you want to sort for (red in our example).

Doing so will instantly sort the dataset based on the selected fill color. As you can see, all the entries with a red cell background are at the top.

Dataset sorted with red cell background entries  at the top

But we wanted to sort all the red cell background entries at the bottom. To do that, follow the steps detailed above, but instead of red, select white in the last step. And you'll get the following:

Dataset sorted with red cell background entries at the bottom

You can use the sort-by-color feature for all sorts of things. For example, if you create a custom to-do list in Google Sheets, you can use the Google Sheets sorting feature to sort data on the basis of priority, urgency, and other metrics.

Sort by Fill Color (Dataset With Multiple Colors)

Suppose in the same dataset, you also have entries with yellow cell backgrounds that mark apartments for which you have been called for an interview.

Now you have more than one fill color in the dataset and want to sort both red and yellow entries so that all the red entries are at the bottom and all the yellow entries are at the top. To do that, follow the steps given below:

  1. Enable sorting and filtering by selecting any cell in the dataset and clicking on the Filter icon in the menu bar.
  2. Click on the filter icon of any column header.
  3. Go to Sort by color > Fill color.
  4. Select the red color option to sort all the red background color entries. This will sort all the red color entries at the top.
    Sorted by red background color
  5. Again, go to Sort by color > Fill color and select the white color option. This will sort all the white-colored entries at the top and the red-colored entries below it.
  6. Dataset sorted by selecting white background color
    Now again, go to Sort by color > Fill color and select the yellow color option. This will sort all the yellow-colored entries at the top, with the white-colored entries below them, and the red-colored entries at last.
    Dataset sorted by selecting yellow color entries

It's important to understand that when there are multiple colors in a dataset, Google Sheets follows a particular trend. When you sort by the first color (red in our case), all the entries with that color get sorted at the top. When you sort by a second color (white in our case), all entries with the second color get sorted at the top, with the first color entries below them.

This trend is followed such that the fill color that you sort last will get sorted at the top while the fill color that you sort first will get sorted at the bottom, as you can note in our case.

How to Sort by Cell Text Color in Google Sheets

Just as you can sort by fill color, Google Sheets also has the option to sort by text color. Let's understand the process by sorting the following dataset by text color:

Dataset for font color

To sort all the red text color entries, follow the steps given below:

  1. Select any cell in the dataset.
  2. Enable sorting and filtering by clicking on the Filter icon in the menu bar.
  3. Click on the filter icon of any column header from the dataset.
  4. Go to Sort by color > Text color.
    Sort by text color
  5. Select the red color option to sort all the red text color entries. This will sort all the red color entries at the top.
    Dataset sorted for red text color

If there are multiple text colors in the dataset, you can follow a similar process. Just remember that Google Sheets follows the same sorting behavior when sorting by text color as it does when sorting by fill color. So, if you have multiple text colors, start by sorting with the text color you want at the bottom and then work your way up so that the text color you want at the top is sorted last.

How to Filter by Color in Google Sheets

If you have a dataset that has entries with various fill colors, you can use the Filter by color feature to show only the selected color entries. To filter your dataset based on fill color, follow the steps below:

  1. Select any cell of the data set and click on the Filter icon to enable sorting and filtering.
  2. Click on the filter icon of any column header from the dataset.
  3. Go to Filter by color > Text color.
    Filter by fill color
  4. Select the fill color for which you want to see the entries. From our sample dataset, if we select the color red, we get:
    Filter for red

As you can see, only the red color entries are shown. To revert to the complete dataset:

  1. Click the filter icon of any column header from the dataset.
  2. Go to Filter by color > Fill color.
  3. Select None, and you'll get the complete dataset back.
    revert to original dataset

You can follow a similar process to filter a dataset by text color. Simply:

  1. Enable sorting and filtering.
  2. Click the filter icon on the column header.
  3. Go to Filter by color > Text color.
    Filter by text color
  4. Select the color you want to filter for.

The dataset will only show entries with the selected text color, while the rest will remain hidden.

Sort and Filter Data Like a Pro

In Google Sheets, you can use both the Sort by fill color and Sort by text color features simultaneously. But it can get difficult to manage both for larger datasets. A great way to make things easier, yet effective, is to use fill color to sort data to create groups and text color to filter out important data from the data set.

But sorting and filtering are not just limited to Google Sheets, you can sort and filter data in Microsoft Excel using various methods. For example, you can sort data in Excel using the SORT function.