View Single Post
  #2   Report Post  
Harlan Grove
 
Posts: n/a
Default

"Jim Bennett" wrote...
....
I would like to be able to reduce the repeating information by having
something like:
L M N O P
--- --- --- --- ---
Year Year Year Name Region
2001 2002 2003 Revenue East

and having my criteria look like:

2001 2002
Revenue dsum(Data,Value,(L1:L2,O1:P2)) dsum(Data,Value,(M1:M2,O1:P2))

Is this possible?


No, which is one of the reasons never to use DSUM, DCOUNT, etc. in Excel
since they're now VERY ANCIENT and nearly useless. Summing with multiple
conditions is easier (though perhaps not quite as fast) using SUMPRODUCT.

=SUMPRODUCT((INDEX(Data,0,Yr)=2001)*(INDEX(Data,0, Nm)="Revenue")
*(INDEX(Data,0,Rg)="East"),INDEX(Data,0,Value))

where Yr, Nm and Rg are the column indices of the Year, Name and Region
columns the Data range. Or you could use MATCH, so instead of

(INDEX(Data,0,Yr)=2001)

you'd use

(INDEX(Data,0,MATCH("Year",INDEX(Data,1,0),0))=200 1)

Alternatively, you could use SQL.REQUEST, but it has memory leak issues if
you need to use many such formulas.