
409
Appendix A: When Your Worksheet Is a Database
3. In the Insert Function dialog box, select a function to open its
Function Arguments dialog box.
From the Database category, I selected DCOUNT and that’s the dialog
box in Figure A-2.
4. In the Function Arguments dialog box, enter the appropriate values
for the arguments.
For the Database, I entered Satellites in the Database box. For the Field,
I entered Average_Distance_X_1000_km in the Field box. This isn’t as
keyboard intensive as it sounds. As I type along, a pop-up appears with
the full name of the field name. Double-clicking the name puts it into the
Field box. For the Range, I entered C1:C2 in the Range box.
The answer, 9, appears in the dialog box.
5. Click OK to put the answer into the selected cell.
All the database functions follow the same format, you access them all the
same way, and you fill in the same type of information in their dialog boxes.
So I’m going to skip over that sequence of steps as I describe each function,
and just discuss the equivalent worksheet formula.
Counting and Retrieving
One essential database capability is to let you know how many records meet a
particular criterion. Another is to retrieve records. Here are the Excel versions.
DCOUNT and DCOUNTA
As I just showed you, DCOUNT counts records. The restriction is that the field
you specify has to contain numbers. If it doesn’t, the answer is zero, as in
=DCOUNT(Satellites,Name,C1:C2)
because no records in the Name field contain numbers.
DCOUNTA counts records in a different way. This one works with any field. It
counts the number of non-blank records in the field that satisfy the criterion.
So this formula returns 9:
=DCOUNTA(Satellites,Name,C1:C2)
29 454060-bapp01.indd 40929 454060-bapp01.indd 409 4/21/09 7:39:36 PM4/21/09 7:39:36 PM