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
- 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.