The SUMIF function in Microsoft Excel is used to returns the sum of cells that meet a single condition. The condition can be based on dates, numbers, or text, and can use logical operators (>, <, <>, =) and wildcards (*, ?) for partial matching.
The syntax for SUMIF is:
=SUMIF(range, criteria, [sum_range])
Where range is the range of cells to apply the criteria to, criteria is the condition that cells must meet, and sum_range is the range of cells to sum. If sum_range is not provided, SUMIF will sum the cells in the range argument instead.
Here are some examples of how to use SUMIF:
- To sum all numbers in a range that are greater than 5:
=SUMIF(range, “>5”)
- To sum all numbers in a range that are equal to a value in another cell:
=SUMIF(range, criteria_cell)
- To sum all numbers in a range that are not equal to a value:
=SUMIF(range, “<>value”)
- To sum all numbers in a range that are between two values:
=SUMIF(range, “>min_value”) + SUMIF(range, “<=max_value”)
- To sum all numbers in a range that contain a specific text string:
=SUMIF(range, “text“)
- To sum all numbers in a range that do not contain a specific text string:
=SUMIF(range, “
Consider the below:
<>*text*”)
SUMIF can only apply one condition at a time. To sum cells using multiple criteria, you can use the SUMIFS function instead.
Here are some tips for using SUMIF:
* The criteria argument can be a text string, a number, a cell reference, a logical test, or a function that returns a logical value.
* The range and sum\_range arguments must have the same size and shape.
* The criteria argument can use wildcards (*, ?) for partial matching.
* The criteria argument can use logical operators (>, <, <>, =) to specify a condition.
* The criteria argument can use the ampersand (&) to concatenate values or cell references.
* The criteria argument can use the tilde (~) to escape a literal wildcard character.
SUMIF is really a powerful and versatile function that can be used to sum cells based on a wide variety of conditions. With a little practice, you can use SUMIF to quickly and easily calculate subtotals and other useful values in your Excel worksheets.
About Author
Discover more from SURFCLOUD TECHNOLOGY
Subscribe to get the latest posts sent to your email.