View Single Post
  #6   Report Post  
Sanford Lefkowitz
 
Posts: n/a
Default

I think the formula also works using just SUM (instead of SUMPRODUCT)

"olasa" wrote:


There is a formula that can be used and it is called sumproduct.

Example: =SUMPRODUCT((B1:B50=18)*(B1:B50<=30))

Each row will be tested
(True)*(True)--1
(False)*(True) --0
and all test will then be summarised, giving you the number persons
between 18 and 30.

Hope it helped
Ola Sandström



Note
If you for some reason want to calculate the average age, this is one
way
=SUMPRODUCT((B1:B50=18)*(B1:B50<=30)*(B1:B50))/SUMPRODUCT((B1:B50=18)*(B1:B50<=30))


--
olasa
------------------------------------------------------------------------
olasa's Profile: http://www.excelforum.com/member.php...o&userid=17760
View this thread: http://www.excelforum.com/showthread...hreadid=389344