search
HomeTopicsexcelPractical Excel skills sharing: How to ignore hidden columns and perform sums?

In the previous article " Sharing of Practical Excel Skills: Using "Conditional Formatting" and "Function Formula" Together", we learned about "Conditional Formatting" and "Function Formula" through 2 examples. With the use of. Today we will talk about data summation and introduce the method of summing by ignoring hidden columns. Come and learn!

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

In our daily work, we often use summation. This problem is simple for everyone. It can be solved by using the SUM function:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

Sometimes a few rows of data may be hidden. In this case, the SUBTOTAL function is used for summation. When there is no hiding, the SUBTOTAL function result is consistent with the SUM function calculation result, as follows:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

Once we add certain rows (such as 3, 6, 9 , 12 rows) the data is hidden, and the result changes, as follows:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

Note that the first parameter of the SUBTOTAL function uses 109 to indicate that the sum of hidden rows is ignored.

Regarding the SUBTOTAL function, tutorials have been published before. Friends who are interested can read the historical articles.

The problem we are going to discuss today is not how to sum if you ignore hidden rows, but how to sum if you ignore hidden columns. First of all, we must make it clear that the SUBTOTAL function cannot do this. It is clearly stated in the help of the function:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

Not only can the SUBTOTAL function not do this, but at present For example, Excel does not yet have a function that ignores hidden columns for summing. So how to deal with this demand? This requires the use of a relatively new function - the CELL function to assist.

I believe that not many friends have seen this function, and even fewer know how to use it. Let’s first briefly understand what the CELL function is used for. Enter =c in the cell and you will see this function. After selecting the function, a simple explanation will appear:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

In this sentence, you can roughly understand Go to the CELL function to get the format, location and other information of a cell. Double-click this function, and some options will appear:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

As you can see, the function has two parameters, info_type and reference. The first parameter info_type, information type, there are 12 types in total. The specific meaning of each type can be understood through the function:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

Friends who are interested in these information types can do so by themselves Take a look, they are all very easy to understand. The most important thing to use today is the last information type "width", which is simply the column width.

Some friends may have thought that if a column is hidden, its column width will be 0. Is this true? We can give it a try. Select "width" as the first parameter of the formula, and set the second parameter to B1, which means you want to get the column width of cell B1 (actually the column width of column B). Enter the formula in cell B16: =CELL("width", B1), and then pull the formula to the right:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

The result is all 8. We can try adjusting the width of individual columns and see if there is any change:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

When we adjust the width, the result is still 8. Is there something wrong with the formula?

In fact, no, the reason is that the CELL function is a bit temperamental. When the format of the cell changes (column width is a format), it must be recalculated to update the result. There are two ways to recalculate, one is to press the F9 function key, the other is to double-click any cell and press Enter. Take a look again and you will find that the result has been updated:

Practical Excel skills sharing: How to ignore hidden columns and perform sums?

The size of the number does correspond to the width of the cell. Speaking of how to ignore hidden column sums, the answer is already obvious: use the CELL function to get the column width, and then use the SUMIF function to implement the sum. Enter the formula in cell I2 as: =SUMIF($B$16:$G$16,">0",B2:G2), and then pull the formula down.

1Practical Excel skills sharing: How to ignore hidden columns and perform sums?

When there is no hiding, all are summed. Now let’s hide a few columns to see the effect:

1Practical Excel skills sharing: How to ignore hidden columns and perform sums?

Remember to press F9 or double-click after hiding.

The problem seems to end here, but there are always some partners who are not willing to use auxiliary columns (auxiliary rows), and want to use array formulas to achieve it, for example: =SUMPRODUCT((CELL("width",B1 :G1>0)*B2:G2)

The idea seems reasonable, but this is not possible because if the parameter reference is a certain cell range, the function CELL will only return the information to the cell range. The cell in the upper left corner of the area. In other words, although I wrote a range like B1:G1, I got only the column width of B1.

Do you think the temper of the cell function is quite strange~~~

In fact, there are many interesting uses of this function. If you want to know, leave a message below!

Related learning recommendations: excel tutorial

The above is the detailed content of Practical Excel skills sharing: How to ignore hidden columns and perform sums?. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:部落窝教育. If there is any infringement, please contact admin@php.cn delete
MEDIAN formula in Excel - practical examplesMEDIAN formula in Excel - practical examplesApr 11, 2025 pm 12:08 PM

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Google Spreadsheet COUNTIF function with formula examplesGoogle Spreadsheet COUNTIF function with formula examplesApr 11, 2025 pm 12:03 PM

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

Excel shared workbook: How to share Excel file for multiple usersExcel shared workbook: How to share Excel file for multiple usersApr 11, 2025 am 11:58 AM

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

How to convert Excel to JPG - save .xls or .xlsx as image fileHow to convert Excel to JPG - save .xls or .xlsx as image fileApr 11, 2025 am 11:31 AM

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

Excel names and named ranges: how to define and use in formulasExcel names and named ranges: how to define and use in formulasApr 11, 2025 am 11:13 AM

This tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo

Standard deviation Excel: functions and formula examplesStandard deviation Excel: functions and formula examplesApr 11, 2025 am 11:01 AM

This tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi

Square root in Excel: SQRT function and other waysSquare root in Excel: SQRT function and other waysApr 11, 2025 am 10:34 AM

This Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The

Google Sheets basics: Learn how to work with Google SpreadsheetsGoogle Sheets basics: Learn how to work with Google SpreadsheetsApr 11, 2025 am 10:23 AM

Unlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools