Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Conditional Aggregation | Calculating Data Like a Pro
Excel Adventure

bookConditional Aggregation

Swipe to show menu

SUMIFS

SUMIFS reads left to right: first you tell it which column to add up, then you give it one or more condition pairs — a column to check and a value to match. Every pair you add narrows the result further. The function only adds a row's value when every condition is satisfied simultaneously, which makes it AND logic by default.

=SUMIFS(sum_range; criteria_range1; criteria1; criteria_range2; criteria2; ...)

=SUMIFS(D:D; B:B; "Dining")
Note
Note

When using comparison operators as criteria, wrap the entire condition in quotes:
">100", "<=50", "<>0". Writing >100 without quotes causes an error.

COUNTIFS

COUNTIFS shares the exact same structure as SUMIFS with one important difference: there is no sum range. You start immediately with condition pairs, because the function is not adding values, it is simply counting how many rows satisfy the criteria. This makes it slightly shorter to write, and it works on any column type, including text columns that SUMIFS would not be able to add.

=COUNTIFS(range1; criteria1; [range2; criteria2]; ...)

=COUNTIFS(G:G; "Variable")
Note
Note

Both functions apply AND logic across multiple conditions — every condition must be satisfied for a row to be included. There is no built-in OR mode; for OR behaviour you need to sum two separate SUMIFS results.

  1. Total spending by category

    In your Summary section, calculate total spending for "Dining" using: =SUMIFS(D:D;B:B;"Dining")

    This adds values from column D only when column B equals "Dining".

  2. Sum of expenses above a threshold

    Calculate total expenses greater than 100 using: =SUMIFS(D9:D35;D9:D35;">100")

    Note that comparison operators must be inside quotes.

  3. Count high-value transactions

    Count how many transactions are flagged as "High" using: =COUNTIFS(F:F;"High")

    This counts all rows where the Flag column equals "High".

  4. Combine multiple conditions

    Calculate total expenses that are both "Dining" and "High" using: =SUMIFS(D:D;B:B;"Dining";F:F;"High")

    This includes only rows where both conditions are true.

  5. Count categorized entries

    Count how many expenses are labeled as "Variable" using: =COUNTIFS(G:G;"Variable")

question mark

You counted "High" transactions using =COUNTIFS(F:F; "High"). Now you want to count only High transactions that are also in the "Dining" category. What should you do?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 6

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Section 3. Chapter 6
some-alt