Calculated Field in a Form-formula problem

RBoshears

New Member
Joined
Oct 28, 2003
Messages
21
I have a form with an underlying query. I am attempting to generate several calculated controls based on fields within the query. Most fields contain either a "yes", "no", "pending", or No Resp". I am trying to count each result within a given field. My formula in the control is

=Count(IIF([field name],yes,0)). The result is always the total number of records, not just the ones with a "yes" in them. Help??? :oops:
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Nope, that generates an error. if I eliminate the 1 in the formula, it runs, but still gives me the total record count, not just the yeses.
 
Upvote 0
with the "" around yes, I get an #error code, without the "", the formula runs, but it is still giving me the total number of records. I have 8 records, with 7 yeses, but the formula result keeps on coming up 8.
 
Upvote 0
I take it the field's a checkbox then, not a text field.

well, I give up.. it works for me!

:whistle:
 
Upvote 0
either way, the formula should work..

one thing to watch out for is that the formula won't calculate if the active record has changed unless it is saved (which is done by leaving for another record, or running a macro after updating it)
 
Upvote 0

Forum statistics

Threads
1,221,618
Messages
6,160,855
Members
451,674
Latest member
TJPsmt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top