Method of summing multiple columns in Excel tables

Source: Internet
Author: User
Tags sumif function

A method for summing multiple columns of conditions in an Excel table. First look at a group of sales data, is a shopping mall, different brands of TV three days sales record:

It is now necessary to calculate its three-day sales totals according to the G-List brand.

Must have a cousin already thought the method, since is by the condition sum, uses the SUMIF function to chant:

=SUMIF (B:B,G2,C:C) +sumif (b:b,g2,d:d) +sumif (b:b,g2,e:e)

The formula sums the conditions of columns C, D, and E, and then adds them.

There's no problem with that, but if you need to sum up 30 columns of data, that's too much of a hassle.

Well, there's a simpler formula:

Here we use the array formula:

=sum (IF (b$2:b$72=g2,c$2:e$72))

First, the IF function is processed, if the b2:b72 is equal to the G2 specified by the cell, returns the value of the corresponding row in the C2:e72 range, otherwise returns the logical value Flase, and the SUM function is used.

This is because the array operation is performed, so after the formula is edited, click the Edit bar, press Shift+ctrl, and then press ENTER. Note that the curly braces on both sides of the formula are automatically generated, and manual typing is not valid.

This formula is shorter, but need to press three keys to input, some new friends may not find the feeling, patience, try more times.

There is also a formula that does not require a three-key entry:

=sumproduct ((B$2:B$72=G2) *c$2:e$72)

First use B$2:B$72=G2 to determine whether B column equals the specified brand, get the logical value TRUE or flase, then multiply the logical value by the C2:E72 value, and finally use the sumproduct to compute the sum of the Chuyang product.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.