Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • What-If Analysis: Scenarios and Goal Seek in Excel
  • How to Use Solver Tool in Excel
  • Chart Axes in Excel
  • How To Load Analysis ToolPak in Excel
  • How to do a t-Test in Excel?

References

  • Perform case-sensitive Lookup in Excel
  • Multi-criteria lookup and transpose in Excel
  • How to get relative row numbers in a range in Excel
  • How to use Excel VLOOKUP Function
  • How to use Excel COLUMN Function

Data Validations

  • Excel Data validation don’t exceed total
  • Excel Data validation exists in list
  • Excel Data validation unique values only
  • Prevent invalid data entering in specific cells
  • Excel Data validation number multiple 100

Sum by group in Excel

by

This tutorial shows how to Sum by group in Excel using the example below;

Formula

=IF(B5=B4,"",SUMIF(B:B,B5,C:C))

Explanation

To subtotal data by group or label, directly in a table, you can use a formula based on the SUMIF function.

In the example shown, the formula in D5 is:

=IF(B5=B4,"",SUMIF(B:B,B5,C:C))

Note: data must be sorted by the grouping column to get sensible results.

How this formula works

The framework of this formula is based on IF, which tests each value in column B to see if its the same as the value in the “cell above”. When values match, the formula returns nothing (“”). When values are different, the IF function calls SUMIF:

SUMIF(B:B,B5,C:C)

In each row where SUMIF is triggered by IF, SUMIF calculates a sum of all matching rows in column C (C:C). The criteria used by SUMIF is the current row value of column B (B5), tested against all of column B (B:B).

Full column references like this are cool and elegant, since you don’t have to worry about where the data begins and ends, but you need to be sure there’s not extra data above or below the table that may get caught by SUMIF.

Post navigation

Previous Post:

How to use Excel CHOOSE Function

Next Post:

Customize Ribbon In Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • Not Equal To ‘<>‘ operator in Excel
  • How to use Excel TRUE Function
  • IF with wildcards in Excel
  • Return blank if in Excel
  • Check multiple cells are equal in Excel

Date Time

  • DATEVALUE function: Description, Usage, Syntax, Examples and Explanation
  • Series of dates by day
  • How to calculate working days left in month in Excel
  • How to calculate nth day of week in month in Excel
  • Add business days to date in Excel

Grouping

  • Group times into 3 hour buckets in Excel
  • Map inputs to arbitrary values in Excel
  • Group times into unequal buckets in Excel
  • Map text to numbers in Excel
  • Group numbers at uneven intervals in Excel

General

  • Count cells that contain errors in Excel
  • Subtotal invoices by age in Excel
  • Basic numeric sort formula in Excel
  • How to calculate percent change in Excel
  • How to add sequential row numbers to a set of data in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning