Counting occurrences of initials with non-exact match option

JoC

New Member
Joined
Sep 26, 2022
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
I am trying to create a spreadsheet that keeps track of the number of times an employee uses a car park. We use our initials to book a parking spot. For example, the data below shows the reserved parking spaces for a week.

AFJEKSSBSB
JRBDAF - FMA trainingTCCC
ST from 2.30pmBCJE

If I use the COUNTIF function, it ignores occurrences in the cells where it does not match exactly, i.e. ST from 2.30 pm.

I think I need to use a LEN SUBSTITUTE combination, but I am not sure how to write the formula to look for a specific initial set and have it ignore any other words/symbols in the range of cells. This functionality is way above my ability to "figure it out" by using Google.

Any help would be greatly appreciated.

Jo
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
A simple Countif() with wildcards would do it.
Book1
ABCDE
1AFJEKSSBSB
2JRBDAF - FMA trainingTCCC
3ST from 2.30pmBCJE
4
5Employee# of times
6AF2
7BC1
8BD1
9CC1
10JE2
11JR1
12KS1
13SB2
14ST1
15TC1
Sheet2
Cell Formulas
RangeFormula
C6:C15C6=COUNTIF($A$1:$E$3,"*"&B6&"*")
 
Upvote 0
With and without the leading wildcard char.

Book2
ABCDE
1AFJEKSSBSB
2JRBDAF - FMA trainingTCCC
3ST from 2.30pmBCJE
4
5IntialsCount 1Count 2
6AF22
7BC11
8BD11
9CC11
10JE22
11JR11
12KS11
13SB22
14ST11
15TC11
16FM01
17PM01
18MA01
Sheet1
Cell Formulas
RangeFormula
B6:B18B6=COUNTIFS($A$1:$E$3,$A6 & "*" )
C6:C18C6=COUNTIFS($A$1:$E$3,"*" & $A6 & "*" )
 
Upvote 0
Thank you for your quick reply. It worked perfectly barring one small issue. We have two people who share initials. We have an MB and then to differentiate the other person they use MBe. When I use the formula as it is, they are both showing as 12 when it should be 1 and 11. Is there a way to modify the wild card string without breaking the ignored extra info written in the cell?
 
Upvote 0
Welcome to the MrExcel board!

Would this work for you?

22 09 28.xlsm
ABCDE
1AFJEKSSBSB
2JRAFaAF - FMA trainingTCCC
3ST from 2.30pmAFa from 2pmBCJE
4
5Employee# of times
6AF2
7BC1
8BD0
9CC1
10JE2
11JR1
12KS1
13SB2
14ST1
15TC1
16AFa2
Count Initials
Cell Formulas
RangeFormula
C6:C16C6=COUNTIF(A$1:E$3,B6)+COUNTIF(A$1:E$3,B6&" *")
 
Upvote 0

Forum statistics

Threads
1,214,913
Messages
6,122,207
Members
449,074
Latest member
cancansova

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