Count if Results

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
How do I count the number of time the record result is greater than 20 in the list t4:t1003?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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")
 
Upvote 0
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))
 
Upvote 0
Please explain the difference between "a result" and "the numerical value of the formula", in precise terms.
 
Upvote 0
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
 
Upvote 0
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?
 
Upvote 0
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?
 
Upvote 0
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)
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,017
Members
448,936
Latest member
almerpogi

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