Friday, February 5, 2010

Amazing DAVERAGE

 
Q: How can I average values in a column for different sub-set rows of data dependant on values in other columns?

DAVERAGE is a very powerful Excel function. It uses capability very much like the advanced autofilter to elect which rows of a "database" (just data in rows and columns with headings) to average. The call looks like answer=DAVERAGE(DataRange, ColumnNumber(or name) to average, Critera range). The criteria range can be a range containing complex "and'ing or'ing, or relational operators (>, < etc). When called from within VBA (answer=application.worksheetfunction.DAVERAGE(DataRange, ColumnNumber(or name) to average, Critera range), this function provides a powerful sub-setting and averaging method. I've recently used it to provide all the interaction levels for a Tagucci L16 experiment.

No comments:

Post a Comment