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

Data Analysis

  • How to calculate average last N values in a table in Excel
  • Use Data Form to input, edit and delete records in Excel
  • Calculate Conditional Percentile ‘IF’ in table in Excel
  • Error Bars in Excel
  • Working With Tables in Excel

References

  • How to use Excel FORMULATEXT function
  • How to create dynamic named range with OFFSET in Excel
  • Create hyperlink with VLOOKUP in Excel
  • Extract all partial matches in Excel
  • Lookup entire row in Excel

Data Validations

  • Excel Data validation must contain specific text
  • Excel Data validation only dates between
  • Excel Data validation allow weekday only
  • Excel Data validation with conditional list
  • Excel Data validation exists in list

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
  • How to use Excel OR Function
  • Complete List of Excel Logical Functions, References and Examples
  • How to use Excel NOT Function
  • How to return blank in place of #DIV/0! error in Excel

Date Time

  • Convert Excel time to Unix time in Excel
  • Convert text timestamp into time in Excel
  • Add decimal hours to time in Excel
  • Calculate total hours that fall between two times in Excel
  • Get work hours between dates and times in Excel

Grouping

  • Group times into unequal buckets in Excel
  • Group arbitrary text values in Excel
  • Group times into 3 hour buckets in Excel
  • If cell contains one of many things in Excel
  • Map text to numbers in Excel

General

  • Excel Default Templates
  • Check if multiple cells have same value in Excel
  • How to fill cell ranges with random number from fixed set of options in Excel
  • Excel Autofill Cell Ranges, Copy, Paste
  • How to password protect excel sheet?
© 2026 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning