Microsoft KB Archive/32741

{| = Excel: Database Functions Return #REF! =
 * width="100%"|

Last reviewed: November 29, 1994

Article ID: Q32741

SUMMARY
When using the database functions DAVERAGE, DCOUNT, DMAX, DMIN, DSTDEV, DSUM and DVAR, the database function, as well as the defined database and criteria, must all be on the same worksheet or macro sheet in versions 1.50 and earlier. If the database or criteria is on a separate worksheet, the formula will return #REF!.

In Microsoft Excel versions 4.0, 3.0 and 2.2, however, the database and criteria can reside on external worksheets. To calculate the database functions from an external sheet, the database and criteria arguments must contain the path to the worksheets containing the database and criteria.

For example, if the database is defined on &quot;DatabaseSheet&quot; and the criteria is defined on &quot;CriteriaSheet&quot;, the following DSUM formula can be used to sum the &quot;Amount&quot; field:

=DSUM(DatabaseSheet!Database,&quot;Amount&quot;,CriteriaSheet!Criteria)
 * }