Excel SUMIF Function
The SUMIF function in Microsoft Excel adds cells in a range that meet a single criterion. It is useful for aggregating data based on specific conditions, such as summing sales for a particular product or region.
Key Topics
- Overview of SUMIF Function
- SUMIF Function Syntax
- Implementation Examples
- Sample Dataset
- Key Takeaways
Overview of SUMIF Function
The SUMIF function evaluates a range against a criterion and sums the corresponding values from another range (or the same range). It is ideal for selective summation in data analysis.
SUMIF Function Syntax
The syntax for the SUMIF function is as follows:
Syntax: =SUMIF(range, criteria, [sum_range])
Parameters:
- range: The range of cells to evaluate against the criterion (required).
- criteria: The condition to sum, such as a number, text, or expression (required).
- sum_range: The range to sum (optional; defaults to range if omitted).
Implementation Examples
Below are examples of how to use the SUMIF function in different scenarios.
Example 1: =SUMIF(B2:B6, ">1000")
— Sums cells in B2:B6 greater than 1000.
Example 2: =SUMIF(A2:A6, "Laptop", B2:B6)
— Sums B2:B6 where A2:A6 equals "Laptop".
Example 3: =SUMIF(C2:C6, "<>"", B2:B6)
— Sums B2:B6 where C2:C6 is non-empty.
Sample Dataset (Excel-style View)
Below is a demo dataset styled like Excel, showing how the SUMIF function can be used to sum sales for a specific product.
A | B | C | |
---|---|---|---|
1 | Product | Sales | Laptop Sales Total |
2 | Laptop | 1500 | =SUMIF(A2:A6, "Laptop", B2:B6) |
3 | Phone | 800 | |
4 | Laptop | 1200 | |
5 | Monitor | 900 | |
6 | Printer | 1100 |
Note: In the dataset, cell C2 uses =SUMIF(A2:A6, "Laptop", B2:B6)
to sum the sales in B2:B6 where the product in A2:A6 is "Laptop". The formula is displayed only in C2 for clarity, as it summarizes the range.
Key Takeaways
- The SUMIF function adds cells in a range that meet a single criterion.
- It allows summing a different range than the evaluated range, e.g.,
=SUMIF(A2:A6, "Laptop", B2:B6)
. - Criteria can be numbers, text, or expressions, e.g.,
">1000"
. - Common uses include aggregating sales by product, region, or category.
- The sample dataset demonstrates SUMIF applied to sum sales for laptops.