• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Easy way to sum up the Highlighted Totals

Rafay Ahmed

New Member
Hi All,
Attached is the sheet, where there are totals of Individual people. What is the EASIEST WAY to sum up all highlighted totals in the given sheet, as I have plenty of data like this.

Thanks
 

Attachments

  • Total.xlsx
    10.9 KB · Views: 15
Hi ,

There is really no easy way to sum all the highlighted values , especially if you have a hundred of them.

The correct thing to do would be to always use the SUBTOTAL function , with 9 as its first parameter ; this does the same operation as the SUM function ; the actual benefit of using SUBTOTAL is that every SUBTOTAL ignores nested SUBTOTAL results.

Thus , if you have a 100 SUBTOTAL results in column C , having a SUBTOTAL formula including the entire range , say C2:C41 , will return the correct sum of all the individual figures , ignoring all the SUBTOTAL results that are in between C2 and C41.

Narayan
 
Hi ,

There is really no easy way to sum all the highlighted values , especially if you have a hundred of them.

The correct thing to do would be to always use the SUBTOTAL function , with 9 as its first parameter ; this does the same operation as the SUM function ; the actual benefit of using SUBTOTAL is that every SUBTOTAL ignores nested SUBTOTAL results.

Thus , if you have a 100 SUBTOTAL results in column C , having a SUBTOTAL formula including the entire range , say C2:C41 , will return the correct sum of all the individual figures , ignoring all the SUBTOTAL results that are in between C2 and C41.

Narayan
Thanks NARAYN,
Can you tell me what this "<>" means?
 
Last edited:
HI Rafay,
You can also replace SUM Function if you have many on the sheet with SUBTOTAL Function.

For Eg.
=SUM(C2:C42)

with

=SUBTOTAL(9,C2:C42)

If you many to replace, use the FIND and REPLACE feature...

Edit > Replace

Find what: =SUM(

Replace with: =SUBTOTAL(9,

Then apply subtotal at the end of every column to get the values apart from INDIVIDUAL subtotals !!

Thanks !
 
Thanks NARAYN,
Can you tell me what this "<>" means?
Note the following for use of SUMTOTAL:

The syntax of the function is:

SUBTOTAL( function_num, ref1, [ref2], ... )

Where the arguments are as follows:


An integer that denotes the calculation type (e.g. sum, average, etc.).
function_num
(See the table below for possible values for function_num).



ref1, [ref2], etc. One or more references to cells containing the values that the calculation is to be performed on.

(Blank cells and cells containing non-numeric values are ignored in the calculation).


REFERENCE: http://www.excelfunctions.net/Excel-Subtotal-Function.html


upload_2017-11-8_15-41-38.png
 

Attachments

  • upload_2017-11-8_15-41-16.png
    upload_2017-11-8_15-41-16.png
    17.8 KB · Views: 3
In the attached is a hotch-potch of the solutions so far with one more user-defined function solution.
If you open the file the list has been filtered by colour and the subtotal is showing in cell C42.
Now clear the autofilter, or remove it altogether and see bosco_yip's solution #2 at cell C43.
At cell C43 there's the user-defined function solution. It uses one of the coloured cells in the list to tell it which colour it should sum.
In the vicinity of I1:K4 are some more examples, some using the colour of the cell above, some using the colour of the cell with the formula in itself.
Stolen from https://www.exceltrick.com/how_to/sum-cells-based-on-background-color/ (Method 2) and there's Chip Pearson's site too where there's a more complex function SumColor at http://www.cpearson.com/excel/colors.aspx
upload_2017-11-10_22-45-50.png
 

Attachments

  • Chandoo36282Total.xlsm
    18.4 KB · Views: 8
Back
Top