countif based on first letter in a range of cells

gberg

Board Regular
Joined
Jul 16, 2014
Messages
180
Office Version
  1. 365
Platform
  1. Windows
I have a list that references project numbers. These project numbers typically start with a number followed by a letter or two numbers followed by a letter but the letter could possibly be the 3rd or 4th characters. The goal would be to identify the first letter in the cell and use that as the criteria for the "countif" function. I would like to accomplish this without a "helper column"

Here is an example of the list and the desired output

81D0024
81D0025
81D0026
7W1013
7W1020
81W0001
7P1026
7P1027
81P0001
81P0002
D
3​
W
3​
P
4​

Thanks for any help!

Greg
 
Glad we could help & thanks for the feedback.
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
This example 81P0001A doesn't work for me with Fluff's formula.
Try this:

varios 28ene2022.xlsm
ABCDE
1First LetterCountCount
281D0024A12
381D0025D33
481D0026W33
57W1013P44
67W1020DXP
781W0001
87P1026A
97PA1027
1081P0001D
1181P0001A
1281A5555
Hoja2
Cell Formulas
RangeFormula
D2:D5D2=COUNT(IF(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A$2:$A$12,"0",""),"1",""),"2",""),"3",""),"4",""),"5",""),"6",""),"7",""),"8",""),"9",""),1)=C2,1))
E2:E5E2=COUNTIFS(A:A,"*"&C2&"???*")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,863
Messages
6,121,978
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top