Different ways of using Single Criterion SUM function in Excel



We have already seen the basic syntax and how to use single criteria SUM in Excel. In this post, we will see how use conditional sum based on difference scenarios. For detailed explanation on SUMIF function please read here.
Examples for Using conditional sum Excel Function SUMIF: Below are the some of theExcel example based on different situations.
Conditional sum Sample data
Sample Data

1. Summing only Negative OR Positive values using Excel SUMIF Function

The below formula will add the "difference" column values whichever is less than zero.
=SUMIF(E2:E20,"<0 -49="-49" nbsp="nbsp" negative="negative" of="of" p="p" returns="returns" sum="sum" value.="value." which="which">
Similarly you can add the values with positive value.
=SUMIF(E2:E20,">0")

Now if we want to find the total variations, we need to sum all negative values and positive values. Below is the formula to find total sum considering absolute values.
=ABS(SUMIF(E2:E20,"<0>0") which returns 86. Here we did calculate the sum of both negative and positive values and then added these two making negative values absolute. 

Note: The SUMIF function can use three arguments. However it is not mandatory to use third argument. If we omit the third argument, then Excel adds the values in the 1st argument when the criteria is met.

2. Summing values based on a different Range:  For this we need to use the third argument of SUMIF functions.  As we know, first argument is the range which should be matched with the criteria(argument 2) and the third argument is the range which should be added when given criteria is met. Following SUMIF formula demonstrates the same.
=SUMIF(E2:E20,">0",C2:C20) which returns 940. In this example, excel adds the "price" where the difference has positive value(Greater than Zero).
3. Summing Values based on a text comparison: Some times we need to compare the text value of a range and then perform SUM.  Following are examples for the same.

=SUMIF(A2:A20,"Apple",C2:C20) which returns 444. This formula adds the range "Price" when "Data" Column has the text "Apple".
=SUMIF(A2:A20,"<>Apple",C2:C20) which returns 997.This formula adds the range "Price" when "Data" Column does not contains text "Apple".

4. Summing Values based on a date Comparison: We can use Excel SUMIF formula to add the values based on given date criteria. Following is the example for the same.
=SUMIF(B2:B20,">="&DATE(2013,1,7),C2:C20) which returns 790.
=SUMIF(B2:B20,">="&TODAY(),C2:C20) which returns 217.

Note: As you might have observed, we have used a expression as a second argument which is a criteria. The expression used in first example is DATE and in second it is Today().DATE function returns the date and Today function returns Todays date.  Also the comparisonoperator, enclosed in a quotation mark is concatenated using & operator with the result of the DATE or TODAY() function.

Please share your thoughts or queries on these examples and also share any tips for using SUMIF function you might know in the comment section.

Related Posts:

  • Excel Formula to return the last nonblank cell in a column or Row Some times in Excel worksheet which we update frequently by adding new data to its columns and we need to reference the last value in a particular column. That is the value most frequently entered. We can achieve this c… Read More
  • Backing Up Your Computer Imagine what would happen if your computer suddenly stopped working. Would you lose any important documents, photos, or other files? It may be possible to repair your computer, but your files may be lost forever. Luckily, yo… Read More
  • Learning Excel Table Features-Introduction Excel Tables are defined as the series of rows and columns with related data which can be managed independently. In the processor of learning Excel, Excel Table is very important because it is a v… Read More
  • How To Make A Facebook Game In this tutorial, we'll learn how to add a HTML5 game made with Construct 2 to Facebook, and how to integrate it with Facebook's features. If you haven't already, download the Free edition of the Construct 2 HTM… Read More
  • Image Marquee In Google Sites Marquee Images : Marquee is a scrolling display of text and images on a web page.  On our site you can find it by the script code, but this way is not easy for everyone. If you want it on your site I'll t… Read More

0 comments: