Counting Fields with Data

K

Kat3n

I have a report with 2 columns consisting of 6 fields each in the detail of a
report. I want a total at the bottom of the columns counting only the fields
with data. How can I do this?
 
A

Allen Browne

If the field is named F1, place a text box in the Report Footer section, and
set its Control Source property to:
=Count([F1])

Access skips nulls when counting or averaging.
 
K

Kat3n

Sorry, I don't understand. This is what it looks like:
F1
F2
F3
F4
F5
F6
------
"Total"
I want to add a "Total" text box that will count fields F1 thru F6 that have
data entered in them.
I've tried: =Count([F1]&[F2]&[F3]&[F4]&[F5]&[F6]) and
=Count([F1]+[F2]+[F3]+[F4]+[F5]+[F6])
Neither worked.
--
Kat3n


Allen Browne said:
If the field is named F1, place a text box in the Report Footer section, and
set its Control Source property to:
=Count([F1])

Access skips nulls when counting or averaging.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Kat3n said:
I have a report with 2 columns consisting of 6 fields each in the detail of
a
report. I want a total at the bottom of the columns counting only the
fields
with data. How can I do this?
 
J

John Spencer

How about something like the following. That should give you a count of
non-null values for each field and then add the count for each field.

=Count(F1) + Count(F2) + ... + Count(F6)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
K

Kat3n

Excellent! Thanks so much for your help!
--
Kat3n


John Spencer said:
How about something like the following. That should give you a count of
non-null values for each field and then add the count for each field.

=Count(F1) + Count(F2) + ... + Count(F6)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Sorry, I don't understand. This is what it looks like:
F1
F2
F3
F4
F5
F6
------
"Total"
I want to add a "Total" text box that will count fields F1 thru F6 that have
data entered in them.
I've tried: =Count([F1]&[F2]&[F3]&[F4]&[F5]&[F6]) and
=Count([F1]+[F2]+[F3]+[F4]+[F5]+[F6])
Neither worked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top