Count the number of times a certain character appears as the nth character in a column

HotLanta

Board Regular
Joined
Nov 3, 2005
Messages
176
Guys I felt I was close to getting this one but I gave up.

In column D I have a column of product IDs. I want in cell A1 a formula that counts the number of times that "8" appears as the 7th character in each product id in column D (from D1:D100) would suffice.

The product IDs look like this:

CC918S8L
CC919S8L
CC910S8L
CC911S1R
CC912S1L

If I could get help to accomplish this I would modify it later in another cell to count the number of times "R" appears as the 8th character and so forth.

Thanks in advance!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Thank you for your reply Marcelo.

That is similar to what I was trying and I think I see my problem now. To keep my post short and sweet I stated I was looking for the nth character to be "8" and this your formula works.

=SUMPRODUCT(--(MID(D1:D100,7,1)="8"))

I actually have 8 in cell B1 so the formula I was wanting to use would then be:

=SUMPRODUCT(--(MID(D1:D100,7,1)=B1))

This is not working. I wanted it this way so I could change cell B1 to match other conditions I need to look for at other times.

Any ideas? Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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