Countif formula help please

  • Thread starter Thread starter ferde
  • Start date Start date
F

ferde

I am trying to build a query that gives me the count of records in a field
that have a value range between 40 and 51. The formula I've tried is
returning the total number of records. I can see I have the wrong formula
but not sure how to correct it ..any help would be greatly appreciated.

Count(IIf([heartrate]>=40,[heartrate]<=51,0))
 
Sum(Abs([heartrate] Between 40 and 51))

The expression [heartrate] Between 40 and 51 will return either -1/True or
0/False. Summing the Absolute value of this expression actually counts the
number of records returning true.
 
Try:
=Sum(iif([heartrate] between 40 and 51, 1, 0)

Make sure this text box is in the Report footer or a Group footer (not in
the Page footer.)
 
Back
Top