Counting multiple letters in cells

allunderme

New Member
Joined
May 16, 2013
Messages
20
Hi,

I have a large list of policy numbers with different letters held within (eg MT/1/PD/101271A, 07BV/17345057, BL/1/ /635663A, MALZ32741) all have different formats and some contain /'s. They have all been manually added so each line differs slightly. I have a list of letter prefixes i wish to identify (BV, MT, MALZ etc) there are 11 in total.

Does anyone know how i can count these letter formats from this list of policy numbers?

Im scratching my head so any help would be really appreciated.

Allun
 
allunderme,

Im still unable to complete my task but i wont be beaten

Can you post a screenshot of the raw data worksheet, and, post a screenshot of the worksheet results (manually formatted by you) that you are looking for?

To post your data, you can download and install one of the following two programs:
Excel Jeanie
MrExcel HTML Maker


If you are not able to give us screenshots:
You can upload your workbook to Box Net,
sensitive data changed
mark the workbook for sharing
and provide us with a link to your workbook.
 
Upvote 0

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
allunderme,



Can you post a screenshot of the raw data worksheet, and, post a screenshot of the worksheet results (manually formatted by you) that you are looking for?

To post your data, you can download and install one of the following two programs:
Excel Jeanie
MrExcel HTML Maker


If you are not able to give us screenshots:
You can upload your workbook to Box Net,
sensitive data changed
mark the workbook for sharing
and provide us with a link to your workbook.

Would an answer to the question posted in #10 be insufficient?
 
Upvote 0
Hi

From these codes i would expect to see

MT - 1
BV - 1
BL - 1
MALZ - 1

Each policy number will only contain one of these 2 or 4 letter codes. There would be no duplication but there would be a number of cells with no code included. I would need to see a count of these also but can be easily caluclated if i have the sum of all coded numbers.

Regards

Allun
 
Upvote 0
Given a sample like:
MT/1/PD/101271A
07BV/17345057
BL/1/ /635663A
MALZ32741

<tbody>
</tbody>

what is the expected outcome?

Hi

From these codes i would expect to see

MT - 1
BV - 1
BL - 1
MALZ - 1

Each policy number will only contain one of these 2 or 4 letter codes. There would be no duplication but there would be a number of cells with no code included. I would need to see a count of these also but can be easily caluclated if i have the sum of all coded numbers.

Regards

Allun

MT/1/PD/101271A MT1
07BV/17345057 BV1
BL/1/ /635663A BL1
MALZ32741 MALZ1

<colgroup><col style="width: 131pt; mso-width-source: userset; mso-width-alt: 6229;" width="175"> <col style="width: 48pt;" span="3" width="64"> <tbody>
</tbody>

D2, copied down:

=COUNTIF($A$2:$A$5,"*"&$C2&IF(LEN($C2)=2,"/*","*"))

Is this what you are after?
 
Upvote 0
This looks great and is working on the majority of cells but seems to be missing out cells with the letter prefix at the beginning. eg BV12125554 or MT5455548.

Can you explain what the formular you have kindly provided is doing and i might be able to tweak it a little.

Regards

Allun
 
Upvote 0
This looks great and is working on the majority of cells but seems to be missing out cells with the letter prefix at the beginning. eg BV12125554 or MT5455548.

Can you explain what the formular you have kindly provided is doing and i might be able to tweak it a little.

Regards

Allun

Are you able to say without any hesitation that, for example, the following would not occur:

BV12125554MTO
BVA12125554
 
Upvote 0
correct the following BV12125554MTO would not occur.

There would never been a combination of two letter prefixes within the policy numbers
 
Upvote 0
correct the following BV12125554MTO would not occur.

There would never been a combination of two letter prefixes within the policy numbers

In that case, the following would suffice:

D2, copied down:

=COUNTIF($A$2:$A$5,"*"&$C2&"*")

which were already suggested in this thread.
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,098
Members
449,205
Latest member
ralemanygarcia

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