Countif & Mid

kevbez1969

New Member
Joined
May 20, 2011
Messages
7
Hi,

I have a range of cells (AC54 to AC91)
Each cell contains a string of numbers and letters (e.g. 112111111211111121111cnyy)

I need a formula to count how many times 'y' appears in positions 23, 24 & 25 in the strings on each cell in the range.

Thanks in advance for any help you can give.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Are you looking for an answer of 2 in that example ?
Try this
Code:
=LEN(MID(AC54,23,3))-LEN(SUBSTITUTE(MID(AC54,23,3),"y",""))
 
Upvote 0
Thanks Jason, that works for the one cell.

How do I then get a total of y's on the whole range of cells, AC54 to AC91?
 
Upvote 0
Sorry, I thought you wanted per cell, this should fix it

=SUMPRODUCT(--(MID(AC54:AC91,{23,24,25},1)="y"))
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,853
Members
452,948
Latest member
UsmanAli786

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