# Count if Results

#### Brew

##### Well-known Member
How do I count the number of time the record result is greater than 20 in the list t4:t1003?

### Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Don't know what you mean by "record result", but if you want to know how many cells in t4:t1003 have a value greater than 20 use:
Code:
``=COUNTIF(T4:T1003,">20")``

This does not give the desired result, it should only count if formula in the cell range gives a result greater than 20, however it counts the numerical value of the formula as well (eg:=IF(T270="Y","x",IF((T270="N")*(T269="Y"),1,U269+1))

Please explain the difference between "a result" and "the numerical value of the formula", in precise terms.

I only had 2 cases in this range where formula gave a result of greater than 20, but the formula returned 20, meaning it counting the numbers in the formula in the cells, that a value greater than 20

This doesn't make sense :
it counting the numbers in the formula in the cells, that a value greater than 20

Are you trying to say that it was counting entries in cells as well as formulae results?

yes, exactly!

The COUNTIF function does not distinguish between cells that have values as entries and values that are the result of formulae. In fact I don't think any functions make that distinction. The whole point of Excel is that you can have formulae to create values that are treated the same as actual entries. I'd say you are going to have to create some VBA to do what you want ... how are your VBA skills?

That makes sense. I would need help with VBA

It'd be something like:
Code:
``````Function CountFormulaeGT(inputrange As Range, intGTcriteria As Integer) As Integer
Application.Volatile
CountFormulaeGT = 0
For Each c In inputrange
If Left(c.Formula, 1) = "=" Then
If c.Value > intGTcriteria Then
CountFormulaeGT = CountFormulaeGT + 1
End If
End If
Next
End Function``````
entered into a cell like this:
=countformulaegt(t4:t1003,20)

Replies
18
Views
314
Replies
9
Views
216
Replies
1
Views
90
Replies
12
Views
287
Replies
1
Views
113

1,216,297
Messages
6,129,958
Members
449,545
Latest member
SURY

### 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.

### Which adblocker are you using?

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

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