View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
IanKR IanKR is offline
external usenet poster
 
Posts: 97
Default sumproduct or sumif?

is one preferable to the other, since i can use either and get the
same result?
thanks


Sumif can test for only one condition, but Sumproduct can test
multiple conditions [ see
http://www.xldynamic.com/source/xld.SUMPRODUCT.html ]. So if you're
testing only one condition, use Sumif.


Although, it is worth mentioning, multiple sumifs could be used to
test for multiple conditions (in some cases) - such as summing data
between two date ranges (where the data is in A1:B10, C6 is the start
date and C7 is the end date in the formula below). My experience has
been that this scenario is still faster than a single sumproduct
formula.

=SUMIF(A1:A10,"="&C6,B1:B10)-SUMIF(A1:A10,""&C7,B1:B10)



Thanks - that's a good technique I haven't seen before.