Accounting percentage(completing of 100%) of date values and ignore anything else in whole column

Copper Contributor

Peace :)

 

I want to account the parentage of completing of a values in a column.

If a date  is inputted then account it as a part of 100% / 111(for example).

(title of column: an email sent to the person on the date of...)

the whole cells of column are 111.

if anything else inputted in the column or still blank, so don't account it.

---------

The 1st cell in the column in my file is : N2.

The location of cell which account the percentage : N113

 

Thanks.

1 Reply

@Aadel_AlYahya 

Excel does not have a built-in method to determine whether a cell contains a date. You can use the following custom VBA function:

Function CountDates(rng As Range) As Long
    Dim cel As Range
    On Error Resume Next
    For Each cel In rng
        CountDates = CountDates - IsDate(cel.Value)
    Next cel
End Function

In N113:

=CountDates(N2:N112)/111

Format N113 as a percentage.