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

Data Analysis

  • How to create running total in an Excel Table
  • Add Outline to Data in Excel
  • How to create Gauge Chart in Excel
  • Understanding Pivot Tables in Excel
  • How To Filter Data in Excel

References

  • VLOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • How to get last row in mixed data with blanks in Excel
  • Last row number in range
  • How to use Excel MMULT Function
  • How to use Excel MATCH Function

Data Validations

  • How To Create Drop-down List in Excel
  • Excel Data validation date in next 30 days
  • Excel Data validation must begin with
  • Excel Data validation require unique number
  • 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

  • OR function Examples in Excel
  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • Complete List of Excel Logical Functions, References and Examples
  • AND function: Description, Usage, Syntax, Examples and Explanation
  • Nested IF function example in Excel

Date Time

  • Generate series of dates by weekends in Excel
  • Count dates in current month in Excel
  • TIME function: Description, Usage, Syntax, Examples and Explanation
  • Convert date string to date time in Excel
  • Get month name from date in Excel

Grouping

  • Group times into 3 hour buckets in Excel
  • Calculate conditional mode with criteria in Excel
  • Running count group by n size in Excel
  • How to randomly assign people to groups in Excel
  • Group times into unequal buckets in Excel

General

  • How to get random value from list or table in Excel
  • Advanced Number Formats in Excel
  • How to generate random number between two numbers in Excel
  • Sum by group in Excel
  • How to choose page/paper size in Excel before Printing
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning