Calculating %

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Am I able to calculate "%" in Access? If so, where...I've done totals in the
queries...but not %

I need to be able to calculate what % of people reported each of the
following stressors in their suicide attempt: (Financial, Relational, Legal,
Chronic Illness, etc). (e.g., What % of people reported Financial stressors?
What % reported Relational...blah, blah, blah...

Note: one suicide attempt may report 1 or more stressors...also, the
stressors are represented by "check boxes" on the main form...

Thank you...

Steve
 
Hi Steve

The checkbox is probably bound to a "yes/no" field in your table, right?

Yes/No fields may cave either the value -1 (yes or true) or 0 (no or false).

Therefore you can count the "yes" records by summing all the values and
taking the absolute value of the result to remove the minus sign.

If you put a textbox in the footer of your form and set its ControlSource
to:
=Abs(Sum([Financial]))
it will show a count of all the "Financial" boxes that are checked.

(Note that "Financial" must match the name of the field in your table)

Now, the percent of records that have "Financial" checked can be calculated
by dividing this number by the total number of records. So you need a
textbox with this ControlSource:
=Abs(Sum([Financial]))/Count(*)

If you set its Format property to "Percent" then the result will display as
a %.
 
Thank you Graham...

Graham Mandeno said:
Hi Steve

The checkbox is probably bound to a "yes/no" field in your table, right?

Yes/No fields may cave either the value -1 (yes or true) or 0 (no or false).

Therefore you can count the "yes" records by summing all the values and
taking the absolute value of the result to remove the minus sign.

If you put a textbox in the footer of your form and set its ControlSource
to:
=Abs(Sum([Financial]))
it will show a count of all the "Financial" boxes that are checked.

(Note that "Financial" must match the name of the field in your table)

Now, the percent of records that have "Financial" checked can be calculated
by dividing this number by the total number of records. So you need a
textbox with this ControlSource:
=Abs(Sum([Financial]))/Count(*)

If you set its Format property to "Percent" then the result will display as
a %.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Shek5150 said:
Am I able to calculate "%" in Access? If so, where...I've done totals in
the
queries...but not %

I need to be able to calculate what % of people reported each of the
following stressors in their suicide attempt: (Financial, Relational,
Legal,
Chronic Illness, etc). (e.g., What % of people reported Financial
stressors?
What % reported Relational...blah, blah, blah...

Note: one suicide attempt may report 1 or more stressors...also, the
stressors are represented by "check boxes" on the main form...

Thank you...

Steve
 
Graham,

Greetings...when I attempted to add the text box (and control source:
=Abs(Sum([Financial]))) you had suggested (in the footer of my form) it only
returned the number of "check boxes" in the active record...so its either
returning a "1" or a "0"...(indicating checked or not for just that record)
so I tried to move the text box from my subform to the main form...then I
just receive an error message...any thoughts...

The end result is...I would like to be able to answer how many records have
this particular "stressor" checked...

Thanks again...

Steve



Graham Mandeno said:
Hi Steve

The checkbox is probably bound to a "yes/no" field in your table, right?

Yes/No fields may cave either the value -1 (yes or true) or 0 (no or false).

Therefore you can count the "yes" records by summing all the values and
taking the absolute value of the result to remove the minus sign.

If you put a textbox in the footer of your form and set its ControlSource
to:
=Abs(Sum([Financial]))
it will show a count of all the "Financial" boxes that are checked.

(Note that "Financial" must match the name of the field in your table)

Now, the percent of records that have "Financial" checked can be calculated
by dividing this number by the total number of records. So you need a
textbox with this ControlSource:
=Abs(Sum([Financial]))/Count(*)

If you set its Format property to "Percent" then the result will display as
a %.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Shek5150 said:
Am I able to calculate "%" in Access? If so, where...I've done totals in
the
queries...but not %

I need to be able to calculate what % of people reported each of the
following stressors in their suicide attempt: (Financial, Relational,
Legal,
Chronic Illness, etc). (e.g., What % of people reported Financial
stressors?
What % reported Relational...blah, blah, blah...

Note: one suicide attempt may report 1 or more stressors...also, the
stressors are represented by "check boxes" on the main form...

Thank you...

Steve
 
Hi Steve

That's very strange! A few things to check:

Are you sure the textbox is in the form footer, and not in the detail
section?

Is "Financial" the name of the yes/no *field* in your form's record source?

Is there more than one record *in the current form recordset* that has
Financial checked?

Is this a continuous form? (not that it should make a difference, but it
would make it easier to see that there were several qualifying records)

--
Later...

Graham Mandeno [Access MVP]
Auckland, New Zealand


Shek5150 said:
Graham,

Greetings...when I attempted to add the text box (and control source:
=Abs(Sum([Financial]))) you had suggested (in the footer of my form) it
only
returned the number of "check boxes" in the active record...so its either
returning a "1" or a "0"...(indicating checked or not for just that
record)
so I tried to move the text box from my subform to the main form...then I
just receive an error message...any thoughts...

The end result is...I would like to be able to answer how many records
have
this particular "stressor" checked...

Thanks again...

Steve



Graham Mandeno said:
Hi Steve

The checkbox is probably bound to a "yes/no" field in your table, right?

Yes/No fields may cave either the value -1 (yes or true) or 0 (no or
false).

Therefore you can count the "yes" records by summing all the values and
taking the absolute value of the result to remove the minus sign.

If you put a textbox in the footer of your form and set its ControlSource
to:
=Abs(Sum([Financial]))
it will show a count of all the "Financial" boxes that are checked.

(Note that "Financial" must match the name of the field in your table)

Now, the percent of records that have "Financial" checked can be
calculated
by dividing this number by the total number of records. So you need a
textbox with this ControlSource:
=Abs(Sum([Financial]))/Count(*)

If you set its Format property to "Percent" then the result will display
as
a %.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Shek5150 said:
Am I able to calculate "%" in Access? If so, where...I've done totals
in
the
queries...but not %

I need to be able to calculate what % of people reported each of the
following stressors in their suicide attempt: (Financial, Relational,
Legal,
Chronic Illness, etc). (e.g., What % of people reported Financial
stressors?
What % reported Relational...blah, blah, blah...

Note: one suicide attempt may report 1 or more stressors...also, the
stressors are represented by "check boxes" on the main form...

Thank you...

Steve
 

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

Back
Top