Count first and last characters

E

Elton Law

Dear Expert,

I have got a file which have a system generated field below. (15 rows)
First character must be either "T", "F", "U".
Last character must be either "D", "S", "U".

How to write a function that can calculate how much "T" or "F" for the first
character under the series.
How to write a function that can calculate how much "D" or "S" for the last
character under the series.

TLD
TLD
FLD
TLD
TND
UU
TNS
TND
TNS
TMD
TMD
TLS
TMS
TLD
TMD
 
J

Jacob Skaria

Hi Elton

Try the below

=SUM(COUNTIF(A:A,{"T","F"}&"*"))
=SUM(COUNTIF(A:A,"*" & {"D","S"}))
 
E

Elton Law

Thanks .... nothing can challenge you ....

Jacob Skaria said:
Hi Elton

Try the below

=SUM(COUNTIF(A:A,{"T","F"}&"*"))
=SUM(COUNTIF(A:A,"*" & {"D","S"}))
 
A

Ashish Mathur

Hi,

you may try this

For counting T or F =SUMPRODUCT(1*(LEFT(D3:D17,1)={"T","F"}))
For counting S or D =SUMPRODUCT(1*(RIGHT(D3:D17,1)={"D","S"}))

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com
 
Top