How do I count cells that contain a number of charctors.

P

Picman

How do I count cells that contain a number of charctors or specific criteria.
i have a column of cells that contain a range of values and i want to count
only the cells that contain a specific type of value (PO-31233334/M8689901)
vs (31233376/M8694101). If this is not possible then I'd like to count cells
that contain a specific number of charactors (20).
 
G

Gary''s Student

To count the number of values in column D that begin with PO:
=SUMPRODUCT((LEFT(D1:D100,2)="PO")*(D1:D100<>""))
 
T

T. Valko

Try these:

=COUNTIF(A1:A100,"PO-31233334/M8689901")

Or, use a cell to hold the criteria:

F1 = PO-31233334/M8689901

=COUNTIF(A1:A100,F1)

To count cells that contain 20 characters:

=SUMPRODUCT(--(LEN(A1:A100)=20))
 
P

Picman

Thanks, that worked to a certain extent but I do have some cells that meet
that criteria (begin with “POâ€) but are still invalid as they do not contain
the correct number of characters or begin with “PO†and are 20 characters in
length but do not meet a standard format (PO-7611189-0710/M895 vs.
PO-31245184/M8768901). The standard that I require to be met is
“PO-########/M#######†and any variances, including being case sanative, be
counted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top