Sorting and filtering data by color is a great way to make data analysis easier and help the users of your worksheet see the highlights and data trends at a quick glance.
In this article
Overview of sorting and filtering data by color and icon set
Sorting and filtering data, along with conditionally formatting data, are integral parts of data analysis and can help you answer questions such as the following:
- Who has sold more than $50,000 worth of services this month?
- Which products have greater than 10% revenue increases from year to year?
- Who are the highest performing and lowest performing students in the freshman class?
- Where are the exceptions in a summary of profits over the past five years?
- What is the overall age distribution of employees?
You sort data to quickly organize your data and to find the data that you want. You filter data to display only the rows that meet criteria that you specify and hide rows that you do not want displayed, for one or more columns of data. You conditionally format data to help you visually explore and analyze data, detect critical issues, and identify patterns and trends. Together, sorting, filtering, and conditionally formatting data can help you and other people who use your spreadsheet make more effective decisions based on your data.
You can sort and filter by format, including cell color and font color, whether you have manually or conditionally formatted the cells.
Use the embedded workbook shown here to work with examples. You can apply filtering and sorting based on color or icon on the Category, M/M Δ%, and Markup columns, change any values, and (if you download the workbook to your computer) update or add new formatting rules.
You can also sort and filter by using an icon set that you created through a conditional format. Use an icon set to annotate and classify data into three to five categories that are separated by a threshold value. Each icon represents a range of values. For example in the following table of icon sets, 3 Arrows icon set, the green arrow that points upward represents higher values, the yellow sideways arrow represents middle values, and the red arrow that points downward represents lower values.
Table of icon sets
You can format cells by using a two-color scale, three-color scale, data bars, and icon sets; format cells that contain specific text, number, date or time values, top or bottom ranked values, above or below average, unique, or duplicate values; and create many rules and manage rules more easily.
Top of Page
Using color effectively when analyzing data
Almost everyone likes colors. The effective use of color in any document can dramatically improve the document's attractiveness and readability. Good use of color and icons in your Excel reports improves decision making by helping to focus users' attention on critical information and by helping users visually understand results. Good use of colors can provide a positive emotional feeling right from the start. On the other hand, bad use of color can distract users, and even cause fatigue if over-used. The following sections provide guidelines to help you make good use of colors, and to avoid bad use of colors.
More about document themes With Excel, it is easy to create consistent themes, and add custom styles and effects. Much of the thought that is required to combine colors effectively has already been done for you by the use of predefined document themes that use attractive color schemes. You can quickly and easily format an entire document to give it a professional and modern look by applying a document theme. A document theme is a set of formatting choices that includes a set of theme colors, a set of theme fonts (including heading and body text fonts), and a set of theme effects (including lines and fill effects).
Use standard colors and limit the number of colors
When you sort and filter by color, you might choose colors that you prefer, and the results may look good to you. But, a critical question that needs to be asked is, "Do your users prefer and see the same colors?" Your computer is capable of displaying 16,777,216 colors in 24-bit color mode. However, most users can distinguish only a tiny fraction of these colors. Furthermore, color quality can vary on computers. Room lighting, paper quality, screen and printer resolution, and browser settings can all be different. Up to 10% of the population has some difficulty distinguishing and seeing some colors. These are important variables that you probably don't have control over.
But you do have control over such variables as color choice, the number of colors, and the worksheet or cell background. By making good choices based on fundamental research, you can help make your colors communicate the correct message and interpretation of your data. You can also supplement colors with icons and legends to help ensure that users understand your intended meaning.
Consider color contrast and background
In general, use colors with a high color saturation, such as bright yellow, medium green, or dark red. Make sure that the contrast is high between the background and the foreground. For example, use a white or gray worksheet background with cell colors, or a white or gray cell color with a font color. If you must use a background color or picture, make the color or picture as light as possible so that the cell or font color is not washed out. If you are relying just on font color, consider increasing the size of the font or setting the font in bold. The larger the font, the easier it is for a user to see or distinguish the color. If necessary, adjust or remove the banding on rows or columns because the banding color might interfere with the cell or font color. All of these considerations go a long way toward helping all users correctly understand and interpret color.
Avoid using color combinations that might decrease the color visibility or confuse the viewer. You don't want to inadvertently create eye-popping art or an optical illusion. Consider using a cell border to distinguish problematic colors, such as red or green, if it is unavoidable to prevent the colors from being next to each other. Use complementary and contrasting colors to enhance contrast, and avoid using similar colors. It pays to know the basic color wheel and how to determine similar, contrasting, and complementary colors.
A similar color is one next to another color on the color wheel (for example, violet and orange are similar colors to red).
A contrasting color is three colors away from a color (for example, blue and green are contrasting colors to red).
Complementary colors are opposite each other on the color wheel (for example, blue-green is the complementary color of red).
If you have time, test out your colors, run them by a few colleagues, try them out in different lighting conditions, and experiment with different computer screen and printer settings.
Tip If you print the document in color, double-check the cell color and cell font for readability. If the cell color is too dark, consider using a white font to improve readability.
Top of Page
Choosing the best colors for your needs
Need a quick summary? Use red, yellow, green, or blue, with a white or gray background.
Assign meaning to the colors that you choose based on your audience and intended purpose. If necessary, provide a legend to specifically clarify the meaning of each color. Most people can easily distinguish seven to ten colors in the same worksheet. Up to 50 colors are possible to distinguish, but would require specialized training, and is beyond the scope of this article.
The Top 10 colors
When you sort and filter data by color, use the following table to help you decide which colors to choose. These colors provide the most dramatic contrast, and, in general, are the easiest for most people to distinguish.
You can easily apply these colors to cells and fonts by using the Fill Color or Font Color buttons in the Font group on the Home tab.
Using colors that naturally convey meaning
When reading financial data, numbers are either in the red (negative) or in the black (positive). A red color conveys meaning because it is an accepted convention. If you want to highlight negative numbers, red is a top color choice. Depending on what type of data that you have, you may be able to use specific colors because they convey meaning to your audience, or perhaps there is an accepted standard for their meaning. For example:
- If our data is about temperature readings, we can use the warm colors (red, yellow, and orange) to indicate a hotter temperature, and the cool colors (green, blue, and violet) to indicate colder temperatures.
- If our data is about topographical data, we can use blue for water, green for vegetation, brown for desert and mountains, and white for ice and snow.
- If our data is about traffic and safety, we can use red for stopped or halted conditions, orange for equipment danger, yellow for caution, green for safety, and blue for general information.
- If your data is about electrical resistors, you can use the standard color code of black, brown, red, orange, yellow, green, blue, violet, gray, and white.
Top of Page
Walking through some examples
Suppose we are preparing a set of reports on product descriptions, pricing, and inventory levels. The following sections illustrate questions typically asked about this data, and how to answer each question by using color and icon sets.
What are the different types of product packaging?
We want to find out the different types of containers for the products, but there is no Container column. We can use the Quantity Per Unit column to manually color each cell, and then sort by color. We can also add a legend to clarify what each color means.
Here's the data we're starting with:
- To manually color each cell according to the color scheme in the preceding table, we clicked each cell and applied a cell color by using the Fill Color button in the Font group on the Home tab.
Tip Use the Format Painter button in the Clipboard group on the Home tab to quickly apply a selected color to another cell.
- We clicked a cell in the Quantity Per Unit column and, on the Home tab in the Editing group, clicked Sort & Filter, and then clicked Custom Sort.
- In the Sort dialog box, we selected Quantity Per Unit under Column, selected Cell Color under Sort On, and then clicked Copy Level twice.
- Under Order, in the first row, we selected the red color, in the second row, selected the blue color, and in the third row, selected the yellow color.
If a cell does not contain any of the colors, such as the cells colored white, those rows remain in place.
Note The colors that are listed are the available colors in the column. There is no default color sort order, and you can't create a custom sort order by using a custom list.
- We added a legend using cells to the right of the data columns.
This example shows the colors applied to the Quantity Per Unit column and the legend.
Which products have a markup above 67% or below 34%?
We want to quickly see the highest and lowest markup values at the top of the report.
This example shows the highest and lowest markup values, using a 3 arrow icon set.
- Select cells E2:E26, and on the Home tab, in the Style group, click the arrow next to Conditional Formatting, click Icon Set, and then select the Three Arrows (Colored) icon set.
- Right-click a cell in the Markup column, point to Sort, and then click Custom Sort.
- In the Sort dialog box, select Markup under Column, select Cell Icon under Sort On, and then click Copy Level.
- Under Order, in the first row, select the green arrow that points upward, and in the second row, select the red arrow that points upward.
Which products need to be reordered right away?
You want to quickly generate a report of products that must be reordered right away, and then mail the report to your staff.
This example shows the products that need to be reordered, based on filtering a cell color.
- Select cells I2:I26, and on the Home tab, in the Style group, click the arrow next to Conditional Formatting, point to Highlight Cells Rules , and then click Equal To.
- Enter Yes in the first box, and then select Light Red Fill with Dark Red Text from the second box.
- Right-click any formatted cell in the column, point to Filter, and then select Filter By Selected Cell's Color.
Tip Hover over the Filter button in the column header to see how the column is filtered.
Which products have the highest and lowest prices and costs?
You want to see the highest and lowest prices and costs grouped together at the top of the report.
This example shows the highest and lowest cost and price values, sorted by the highest value followed by the lowest value and grouped together to easily identify them.
- For cells C2:C26 and D2:D26, do the following:
For either the Cost or the Price column, do the following:
- On the Home tab, in the Style group, click the arrow next to Conditional Formatting, point to Top/Bottom Rules, and then click Top 10 Items.
- Enter 1 in the first box, and then select Yellow Fill with Dark Yellow Text from the second box.
- On the Home tab, in the Style group, click the arrow next to Conditional Formatting, point to Top/Bottom Rules, and then click Bottom 10 Items.
- Enter 1 in the first box, and then select Green Fill with Dark Green Text from the second box.
- Right-click the lowest value, point to Sort, and then select Put Selected Cell Color On Top.
- Right-click the highest value, point to Sort, and then select Put Selected Cell Color On Top.
Top of Page