Intro
Learn Excel Sumif Visible Cells to filter and sum data based on conditions, using formulas and functions like Sumif, Sumifs, and AutoFilter, for efficient data analysis and reporting in Microsoft Excel.
When working with Excel, it's common to encounter situations where you need to sum values based on certain conditions, but only for cells that are visible. This can be particularly useful when you're dealing with filtered data or when you want to exclude hidden rows or columns from your calculations. The SUMIF function in Excel is a powerful tool for summing cells based on conditions, but it sums all cells that meet the criteria, regardless of their visibility. However, there are ways to adapt it or use other functions in combination to achieve the goal of summing only visible cells that meet a specific condition.
To understand how to sum visible cells based on conditions, let's first look at the basic syntax of the SUMIF function:
SUMIF(range, criteria, [sum_range])
range
is the range of cells that you want to apply the criteria against.criteria
is the condition that must be met.[sum_range]
is an optional argument that specifies the actual cells to sum. If omitted, Excel sums the values in therange
argument.
However, the SUMIF function does not inherently distinguish between visible and hidden cells. To sum only visible cells, you can use the SUBTOTAL function or combine the SUMIF function with the FILTERXML function (in Excel 2019 and later versions) or use an array formula with the SUM and IF functions in earlier versions of Excel.
Using SUBTOTAL
The SUBTOTAL function ignores hidden rows, making it useful for summing visible cells. However, it does not directly allow for conditional summing like SUMIF. You can use it in combination with filtering to achieve your goal:
- Filter your data to only show the rows that meet your criteria.
- Use the SUBTOTAL function to sum the visible cells.
The syntax for SUBTOTAL is:
SUBTOTAL(function_num, ref1, [ref2],...)
function_num
specifies which function to use (109 for SUM).ref1
,ref2
, etc., are the ranges you want to sum.
Example:
=SUBTOTAL(109, A1:A10)
This will sum all visible cells in the range A1:A10.
Using FILTERXML (Excel 2019 and later)
For a more dynamic approach that combines conditional summing with the visibility of cells, you can use the FILTERXML function along with the SUM function in Excel 2019 and later versions:
=SUM(FILTERXML("" & TEXTJOIN(" ", TRUE, IF((A1:A10="criteria"), B1:B10, "")) & " ", "//d[.!='']"))
Assuming your criteria are in column A and the values to sum are in column B, this formula sums the values in column B for rows where the criteria in column A are met and the cells are visible.
Using Array Formula with SUM and IF
In earlier versions of Excel that do not support FILTERXML, you can use an array formula to achieve a similar result. This method involves using the SUM and IF functions together in an array formula that ignores blank cells (which can represent hidden or filtered-out data):
=SUM(IF((A1:A10="criteria")*(B1:B10<>""), B1:B10, ""))
Press Ctrl+Shift+Enter
instead of just Enter
to make this an array formula.
Gallery of Excel Functions

Sumif Visible Cells Example

Using Excel Formulas

Excel Tips and Tricks

Advanced Excel Techniques

Excel Formula Examples

Excel Functions Gallery

Excel Tutorial

Excel Guide

Gallery of Excel Sumif
Gallery of Excel Sumif
Excel Sumif Image Gallery










FAQs
What is the SUMIF function in Excel?
+The SUMIF function is used to sum cells based on a condition.
How do I sum only visible cells in Excel?
+You can use the SUBTOTAL function or combine the SUMIF function with other functions like FILTERXML or use array formulas.
What is the difference between SUMIF and SUBTOTAL in Excel?
+SUMIF sums all cells that meet a condition, while SUBTOTAL ignores hidden rows and can be used to sum only visible cells.
If you're looking to enhance your Excel skills, especially in summing visible cells based on conditions, practicing with the SUMIF, SUBTOTAL, and other related functions is key. Remember, the ability to adapt these functions to your specific needs can greatly improve your efficiency in data analysis and manipulation. Feel free to share your experiences or ask for further clarification on any of the methods mentioned above. Your input can help create a more comprehensive guide for everyone looking to master Excel functions.