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

Data Analysis

  • Understanding Anova in Excel
  • How to create Gauge Chart in Excel
  • Filter Data Based on Date in Excel
  • What-If Analysis: Scenarios and Goal Seek in Excel
  • Move chart to a separate worksheet in Excel

References

  • Last row number in range
  • Count rows with at least n matching values
  • How to get last column number in range in Excel
  • Offset in Excel
  • Count rows that contain specific values in Excel

Data Validations

  • Excel Data validation must contain specific text
  • Excel Data validation number multiple 100
  • Excel Data validation specific characters only
  • Prevent invalid data entering in specific cells
  • Excel Data validation date in next 30 days

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.

Worked Example:   Sum if cells are not equal to in Excel

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).

Worked Example:   3D SUMIF for multiple worksheets in Excel

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.

Worked Example:   How to calculate current stock or inventory in Excel

Post navigation

Previous Post:

44 Practical Excel IF function Examples

Next Post:

Large with criteria 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, AND, OR and NOT Functions Examples in Excel
  • IFERROR function: Description, Usage, Syntax, Examples and Explanation
  • FALSE function: Description, Usage, Syntax, Examples and Explanation
  • OR function Examples in Excel
  • How to return blank in place of #DIV/0! error in Excel

Date Time

  • Get fiscal year from date in Excel
  • How to calculate quarter from date in Excel
  • Convert text timestamp into time in Excel
  • Series of dates by day
  • DAY function: Description, Usage, Syntax, Examples and Explanation

Grouping

  • If cell contains one of many things in Excel
  • Calculate conditional mode with criteria in Excel
  • Group times into unequal buckets in Excel
  • How to randomly assign data to groups in Excel
  • Map text to numbers in Excel

General

  • How to calculate percent variance in Excel
  • How to test a range for numbers in Excel
  • Count cells that contain errors in Excel
  • Subtotal by color in Excel
  • How to count total columns in range in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning