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

Data Analysis

  • Subtotal function in Excel
  • Conditional Formatting Icon Sets Examples in Excel
  • How to create running total in an Excel Table
  • How to create a Histogram in Excel
  • How to sum a total in multiple Excel tables

References

  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions
  • Lookup entire row in Excel
  • How to get last row in text data in Excel
  • How to use Excel FORMULATEXT function
  • How to use Excel ROWS Function

Data Validations

  • Excel Data validation require unique number
  • Excel Data validation unique values only
  • Data validation must not exist in list
  • Excel Data validation exists in list
  • Excel Data validation must begin with

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

  • IF with boolean logic in Excel
  • Check multiple cells are equal in Excel
  • IF with wildcards in Excel
  • Invoice status with nested if in Excel
  • IF, AND, OR and NOT Functions Examples in Excel

Date Time

  • How to calculate next day of week in Excel
  • Get first day of previous month in Excel
  • Get project end date in Excel
  • Add workdays no weekends in Excel
  • Get days before a date in Excel

Grouping

  • If cell contains one of many things in Excel
  • How to randomly assign data to groups in Excel
  • Group numbers at uneven intervals in Excel
  • Running count group by n size in Excel
  • Map inputs to arbitrary values in Excel

General

  • How to set or clear a print area in Excel Worksheet
  • Split Cell Content Using Text to Columns in Excel
  • How to count total number of cells in a rectangular range in Excel
  • How to calculate percentage of total in Excel
  • Convert column letter to number in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning