Excel Tips: Effortless SUM & COUNT by Cell Color Explained
Excel
Jul 15, 2025 4:03 AM

Excel Tips: Effortless SUM & COUNT by Cell Color Explained

by HubSite 365 about Kenji Farré (Kenji Explains) [MVP]

Co-Founder at Career Principles | Microsoft MVP

Pro UserExcelLearning Selection

Excel, SUBTOTAL, SUMIF, COUNTIF, VBA

Key insights

  • SUM and COUNT by Color: Excel does not have a built-in function to sum or count cells based on their fill color, font color, or conditional formatting color. Users often need this feature for analyzing color-coded data.

  • Filter by Color + SUBTOTAL Function: By using the Filter by Color option with the SUBTOTAL function, you can easily sum or count only the visible cells that match a specific color. This method is quick and requires no coding but needs manual filtering each time.

  • GET.CELL Function with Named Ranges: The undocumented GET.CELL function helps extract cell color codes via named ranges. After setting up a helper column with these codes, you can use SUMIF or COUNTIF functions to calculate totals based on color. This approach is formula-driven but takes more effort to set up and maintain.

  • Custom VBA Functions (Macros): Writing custom VBA code allows you to create your own functions like SumCellsByColor and CountCellsByColor. These solutions are fully automated, flexible, and reusable across different workbooks, making them ideal for advanced users who need frequent updates.

  • Main Advantages of Each Method: The filter method is simple and requires no programming skills. The GET.CELL approach offers dynamic results without macros. Custom VBA provides full automation and works well for large or complex tasks involving colors.

  • Current Trends (2024-2025): More users rely on custom VBA functions as Excel tutorials highlight their power for handling colored data. The

    Introduction: Addressing Color-Based Analysis in Excel

    Summing and counting cells by color in Excel is a task that frequently arises for professionals working with visually categorized or prioritized data. However, as Kenji Farré (Kenji Explains) [MVP] points out in his latest YouTube tutorial, this feature is not directly built into Excel’s core functions. As a result, users often need to explore alternative methods to achieve this functionality. In his video, Kenji systematically demonstrates three distinct approaches, each with its own strengths and limitations, making the topic especially relevant for analysts and business users in 2025.

    Understanding these options is essential for anyone seeking to leverage Excel’s powerful data analysis capabilities while working with color-coded spreadsheets. The video covers practical steps and discusses the tradeoffs between ease of use, automation, and technical setup.

    Traditional Approach: Filter by Color and SUBTOTAL

    The first method Kenji demonstrates relies on Excel’s built-in Filter by Color feature, paired with the SUBTOTAL function. This approach is both intuitive and accessible, requiring no additional coding or complex setup. Users can simply apply a filter to their dataset, select the desired color, and then use SUBTOTAL to sum or count only the visible, filtered cells.

    While this method is quick and suitable for basic tasks, it has notable limitations. For instance, it only provides results for one color at a time and requires manual adjustment whenever the color focus changes. Moreover, since only filtered data is considered, users cannot view totals for all colors simultaneously. Nevertheless, this method remains popular due to its simplicity and the fact that it leverages Excel’s native features.

    Intermediate Solution: GET.CELL and Named Ranges

    For those seeking a more dynamic, formula-driven approach without using macros, Kenji introduces the GET.CELL function via named ranges. By creating a named range that extracts the color code of each cell, users can then employ standard Excel functions like SUMIF or COUNTIF to aggregate data based on color.

    However, this method is somewhat tedious to set up and requires careful management of helper columns and named formulas. Additionally, it does not update automatically if cell colors change, often requiring manual recalculation. Despite these challenges, the GET.CELL approach is valued for its ability to provide dynamic results and its compatibility with environments where macros are restricted.

    Advanced Automation: Custom VBA Functions

    Recognizing the limitations of manual and semi-automated solutions, Kenji highlights the advantages of using custom VBA functions to sum and count cells by color. By writing simple VBA code, users can create reusable functions that work seamlessly across different workbooks. These functions can target both fill and font colors, offering a high degree of flexibility and automation.

    The key benefit here is that results update automatically when data changes, and users can analyze multiple colors without repeated manual intervention. On the other hand, introducing VBA requires enabling macros, which may not be permitted in all organizations due to security policies. Furthermore, not every Excel user is comfortable writing or maintaining VBA code, which can limit accessibility for some audiences.

    Trends and Considerations for 2024-2025

    As Excel continues to evolve, Kenji notes a growing trend toward using VBA-based solutions for color-based aggregation, especially among advanced users and businesses seeking more automation. Meanwhile, the Filter by Color and SUBTOTAL method remains a favorite for quick, one-off analyses that do not require ongoing maintenance.

    The GET.CELL approach still appeals to those who prefer not to use macros, yet its setup complexity and lack of real-time updates can be challenging. Ultimately, the choice between these methods involves balancing ease of use, automation, and organizational constraints—tradeoffs that each user must evaluate based on their specific needs and technical comfort.

    Conclusion: Choosing the Right Approach

    In summary, Kenji Farré’s video provides a thorough overview of how to sum and count cells by color in Excel using three distinct strategies: Filter + SUBTOTAL, GET.CELL with named ranges, and custom VBA functions. Each method offers unique advantages and poses its own challenges, from simplicity and manual effort to automation and technical setup.

    By weighing these tradeoffs, users can select the approach that best fits their workflow and organizational requirements. As Excel’s user community continues to innovate, these techniques remain vital tools for extracting meaning from color-coded data in spreadsheets.

    Excel - Excel Tips: Effortless SUM & COUNT by Cell Color Explained

    Keywords

    sum cells by color excel count colored cells excel sum by cell color count by cell color excel how to sum colored cells count colored cells in excel formula sum if cell color excel