Table of Contents
The SUMIF function in Excel is a useful tool for calculating the sum of a specific range of values based on a given criteria. This function allows users to specify a range of cells to be evaluated and a criteria to be met, and then adds up only the values that meet this criteria. By using the SUMIF function, users can easily perform calculations on a specific set of data, making it a valuable tool for data analysis and reporting. This function can be applied to various scenarios, such as calculating the total sales for a specific product or the total expenses for a particular department. Overall, the SUMIF function in Excel provides an efficient and effective way to calculate sums based on specific criteria, making it an essential feature for working with large datasets.
You use the SUMIF function to sum the values in a range that meet criteria that you specify. For example, suppose that in a column that contains numbers, you want to sum only the values that are larger than 5. You can use the following formula: =SUMIF(B2:B25,”>5″)

This video is part of a training course called Add numbers in Excel.
Tips:
If you want, you can apply the criteria to one range and sum the corresponding values in a different range. For example, the formula =SUMIF(B2:B5, “John”, C2:C5) sums only the values in the range C2:C5, where the corresponding cells in the range B2:B5 equal “John.”
To sum cells based on multiple criteria, see SUMIFS function.
Important: The SUMIF function returns incorrect results when you use it to match strings longer than 255 characters or to the string #VALUE!.
Syntax
SUMIF(range, criteria, [sum_range])
The SUMIF function syntax has the following arguments:
range Required. The range of cells that you want evaluated by criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored. The selected range may contain dates in standard Excel format (examples below).
criteria Required. The criteria in the form of a number, expression, a cell reference, text, or a function that defines which cells will be added. Wildcard characters can be included – a question mark (?) to match any single character, an asterisk (*) to match any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) preceding the character.
For example, criteria can be expressed as 32, “>32”, B5, “3?”, “apple*”, “*~?”, or TODAY().
Important: Any text criteria or any criteria that includes logical or mathematical symbols must be enclosed in double quotation marks (“). If the criteria is numeric, double quotation marks are not required.
sum_range Optional. The actual cells to add, if you want to add cells other than those specified in the range argument. If the sum_range argument is omitted, Excel adds the cells that are specified in the range argument (the same cells to which the criteria is applied).
Sum_range should be the same size and shape as range. If it isn’t, performance may suffer, and the formula will sum a range of cells that starts with the first cell in sum_range but has the same dimensions as range. For example:
range
sum_range
Actual summed cells
A1:A5
B1:B5
B1:B5
A1:A5
B1:K5
B1:B5
Examples
Example 1
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.
Property Value | Commission | Data |
|---|---|---|
$100,000 | $7,000 | $250,000 |
$200,000 | $14,000 | |
$300,000 | $21,000 | |
$400,000 | $28,000 | |
Formula | Description | Result |
=SUMIF(A2:A5,”>160000″,B2:B5) | Sum of the commissions for property values over $160,000. | $63,000 |
=SUMIF(A2:A5,”>160000″) | Sum of the property values over $160,000. | $900,000 |
=SUMIF(A2:A5,300000,B2:B5) | Sum of the commissions for property values equal to $300,000. | $21,000 |
=SUMIF(A2:A5,”>” & C2,B2:B5) | Sum of the commissions for property values greater than the value in C2. | $49,000 |
Example 2
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.
Category | Food | Sales |
|---|---|---|
Vegetables | Tomatoes | $2,300 |
Vegetables | Celery | $5,500 |
Fruits | Oranges | $800 |
Butter | $400 | |
Vegetables | Carrots | $4,200 |
Fruits | Apples | $1,200 |
Formula | Description | Result |
=SUMIF(A2:A7,”Fruits”,C2:C7) | Sum of the sales of all foods in the “Fruits” category. | $2,000 |
=SUMIF(A2:A7,”Vegetables”,C2:C7) | Sum of the sales of all foods in the “Vegetables” category. | $12,000 |
=SUMIF(B2:B7,”*es”,C2:C7) | Sum of the sales of all foods that end in “es” (Tomatoes, Oranges, and Apples). | $4,300 |
=SUMIF(A2:A7,””,C2:C7) | Sum of the sales of all foods that do not have a category specified. | $400 |
Cite this article
stats writer (2024). How can I use the SUMIF function in Excel to calculate the sum of a specific range based on a given criteria?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-the-sumif-function-in-excel-to-calculate-the-sum-of-a-specific-range-based-on-a-given-criteria/
stats writer. "How can I use the SUMIF function in Excel to calculate the sum of a specific range based on a given criteria?." PSYCHOLOGICAL SCALES, 1 Jul. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-the-sumif-function-in-excel-to-calculate-the-sum-of-a-specific-range-based-on-a-given-criteria/.
stats writer. "How can I use the SUMIF function in Excel to calculate the sum of a specific range based on a given criteria?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-the-sumif-function-in-excel-to-calculate-the-sum-of-a-specific-range-based-on-a-given-criteria/.
stats writer (2024) 'How can I use the SUMIF function in Excel to calculate the sum of a specific range based on a given criteria?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-the-sumif-function-in-excel-to-calculate-the-sum-of-a-specific-range-based-on-a-given-criteria/.
[1] stats writer, "How can I use the SUMIF function in Excel to calculate the sum of a specific range based on a given criteria?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, July, 2024.
stats writer. How can I use the SUMIF function in Excel to calculate the sum of a specific range based on a given criteria?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
