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

Data Analysis

  • How to Create Thermometer Chart in Excel
  • Get column index in Excel Table
  • How To Insert and Customize Sparklines in Excel
  • How to create a Histogram in Excel
  • Excel Frequency Function Example

References

  • How to get relative column numbers in a range in Excel
  • Find Closest Match in Excel Using INDEX, MATCH, ABS and MIN functions
  • Count rows that contain specific values in Excel
  • How to get address of named range in Excel
  • Convert text string to valid reference in Excel using Indirect function

Data Validations

  • Excel Data validation must begin with
  • Data validation must not exist in list
  • Excel Data validation allow weekday only
  • Excel Data validation date in specific year
  • Excel Data validation specific characters only

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

  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • AND function: Description, Usage, Syntax, Examples and Explanation
  • Not Equal To ‘<>‘ operator in Excel
  • How to use Excel AND Function
  • IF with wildcards in Excel

Date Time

  • Count holidays between two dates in Excel
  • Get fiscal quarter from date in Excel
  • Add days exclude certain days of week in Excel
  • Display the current date and time in Excel
  • Find Last Day of the Month in Excel

Grouping

  • Running count group by n size in Excel
  • Calculate conditional mode with criteria in Excel
  • Group numbers at uneven intervals in Excel
  • Categorize text with keywords in Excel
  • Map inputs to arbitrary values in Excel

General

  • Select, Insert, Rename, Move, Delete Worksheets in Excel
  • Cell References: Relative, Absolute and Mixed Referencing Examples
  • 44 Practical Excel IF function Examples
  • How to generate random date between two dates in Excel
  • Basic error trapping example in Excel
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning