Go Back

How to Find Subtotal by Color in Excel

Excel helps us to subtotal by color in an efficient manner. We can use the SUMIF function to perform subtotal by color in Excel. It helps to add cells based on numbers, dates, and text matching certain criteria. In this tutorial, we will learn how to subtotal by color in Excel.

Figure 1. Example of How to Subtotal by Color

Generic Formula


  • range_color: This argument is required. It is the range for which the criteria of color will be applied. This takes an absolute reference and is not changed when we copy the formula down.
  • criteria: This is also required. Picks up the criteria from the adjacent cell. Uses a relative reference. Changes when copied down.
  • Range_number: This value is optional. The cells which are to be added together by SUMIF.

Here, we apply the criteria to the range of cells provided as range_color. Next, the reference obtains the criteria. Then, range_number specifies the cells that Excel adds together. Finally, subtotal adds the numbers and returns the result.

Setting Up Data

The following example uses a wall paint sales database for four colors. Column A has the color names, column B the quantity and column C the sales.

Figure 2. The Sample Data Set

To find out the subtotal by color in column F:

  • We need to go to cell F8.
  • Assign the formula =SUMIF($A$2:$A$20,E8,$C$2:$C$20) to cell F8.
  • Press Enter.

Figure 3. Example of Applying the Formula to Subtotal by Color

  • Drag the formula from cells F8 to F11 using the fill handle on the bottom right.

This will show the subtotal by colors in column F.

We can subtotal by color using the SUMIF function very easily. However, if we want to  count or add cells filled with colors, we need to do it in a different way. We can use the same logic to count the cells when using conditional formatting to apply colors. If the cells are filled with colors manually, we’ll need to follow a different approach.

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

Use the Subtotal feature to calculate the average Salary by Location.
Solved by D. D. in 17 mins
I need to take the amount due from subtotal column then multiply by .1 which is 10% then divide by 12 to get the interest due per month. Then multiply by the number of months then add to subtotal to get the total due.
Solved by T. J. in 25 mins
Use Subtotal to calculate the average Selling Price, % of Asking Price and Days on Market by City
Solved by T. Q. in 30 mins

Leave a Comment