Can we use Multiple logic in single criteria in Countif function in VBA?
Example: Col A contains similar names like Joe and Joseph I need the count of these using Countif function, how can I achieve this?
Thanks in advance...
Try:
=COUNTIF(A1:A3,"Joe") + COUNTIF(A1:A3,"Joseph")
You may try wildcards if your criteria follows specific format like:
=COUNTIF(A1:A10,"Jo*")
Above will count all entries beginning Jo.
Another way is to use array constant and incorporate SUMPRODUCT function.
=SUMPRODUCT(COUNTIF(A1:A10,{"Joseph","Joe"}))
Above counts Joseph and Joe. You can also use Range reference in place of array constants.
=SUMPRODUCT(COUNTIF(A1:A10,B1:B2))
Where B1:B2 contains your criteria.