Leading the way in Microsoft Office Development
 Home|

Excel

|Word|PowerPoint|Consultancy|Feedback|Contact 
 Excel > Array Formulas > Multiple Conditions< Previous | Next > 

 

COUNT and SUM Functions

 
 

You can use the COUNTIF() and SUMIF() to quickly return the number of cells or the total value for a given criteria.

 
 

It is possible though to obtain the same information just by using the regular SUM() function with array formulas.

 
   

 

COUNT Matching Rows

 
 

You can use the COUNTIF() to return the number of cells that satisfy a given criteria.

 
 

Alternatively you can also use the SUM() function with array formulas.

 

 

What is the total number of transactions where Quantity = 5

 
 
{=SUM(1*(D3:D20=5))} = 6
 

 

What is the total number of transactions where Quantity = 5 or Quantity = 10

 
 
{=SUM((D3:D20=5)+(D3:D20=10))} = 12
 

 

What is the total number of transactions where Quantity = 5 and Location = New York

 
 
{=SUM((D3:D20=5)*(B3:B20="New York"))} = 2
 

 

SUM Matching Rows

 
 

You can use the SUMIF() to add the cells specified by a given criteria.

 
 

Alternatively you can also use the SUM() function with array formulas.

 

 

What is the total price for all the transactions where Quantity = 5

 
 
{=SUM((D3:D20=5)*E3:E20)} = 14,886
 

 

What is the total price for all the transactions where Quantity = 5 or Quantity = 10

 
 
{=SUM(((D3:D20=5)+(D3:D20=10))*E3:E20)} = 38,647
 

 

What is the total price for all the transactions where Quantity = 5 and Location = New York

 
 
{=SUM(((D3:D20=5)*(B3:B20="New York"))*E3:E20)} = 2,485
 

 Copyright © 2010 Better Solutions Limited. All Rights Reserved.< Previous | Top | Next >