PERCENTAGEIFS

PERCENTAGEIFS(rgeValues, sCondition, iDecimalPlaces)
Returns the percentage of numbers in a range that satisfy multiple conditions.

rgeValuesThe range of values.
sConditionThe condition you want to use.
iDecimalPlacesThe number of decimal places you want the percentage returned as.

REMARKS
??

Public Function PERCENTAGEIFS( _ 
         ByVal rgeValues As Range, _
         ByVal sCondition As String, _
         ByVal iDecimalPlaces As Integer) _
         As Double

   PERCENTAGEIFS = VBA.Round((Application.WorksheetFunction.CountIf(rgeValues, sCondition) / _
                 Application.WorksheetFunction.Count(rgeValues)) * 100, iDecimalPlaces)

End Function

For instructions on how to add this function to a workbook refer to the page under Inserting Functions


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext