Hi All,
I could really use some help with this.
=COUNTIF(J16:J575,"Late")/COUNTA(J16:J575)*100
This Formula will give me the average but it will not change as the filters are used?
I created a formula in VBA that does work and will change as the filter changes but will only work on numbers, not on time/late/early..
Function AverVisible(Rg As Range)
'UpdateByKutoolsforExcel20151208
Dim xCell As Range
Dim xCount As Integer
Dim xTtl As Double
Application.Volatile
Set Rg = Intersect(Rg.Parent.UsedRange, Rg)
For Each xCell In Rg
If xCell.ColumnWidth > 0 _
And xCell.RowHeight > 0 _
And Not IsEmpty(xCell) _
And IsNumeric(xCell.Value) Then
xTtl = xTtl + xCell.Value
xCount = xCount + 1
End If
Next
If xCount > 0 Then
AverVisible = xTtl / xCount
Else
AverVisible = 0
End If
End Function
If someone knows anything that could help it would be greatly appreciated
- Jessy
I could really use some help with this.
=COUNTIF(J16:J575,"Late")/COUNTA(J16:J575)*100
This Formula will give me the average but it will not change as the filters are used?
I created a formula in VBA that does work and will change as the filter changes but will only work on numbers, not on time/late/early..
Function AverVisible(Rg As Range)
'UpdateByKutoolsforExcel20151208
Dim xCell As Range
Dim xCount As Integer
Dim xTtl As Double
Application.Volatile
Set Rg = Intersect(Rg.Parent.UsedRange, Rg)
For Each xCell In Rg
If xCell.ColumnWidth > 0 _
And xCell.RowHeight > 0 _
And Not IsEmpty(xCell) _
And IsNumeric(xCell.Value) Then
xTtl = xTtl + xCell.Value
xCount = xCount + 1
End If
Next
If xCount > 0 Then
AverVisible = xTtl / xCount
Else
AverVisible = 0
End If
End Function
If someone knows anything that could help it would be greatly appreciated
- Jessy