Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel function = how many times AB occurs in 1 cell 2

Status
Not open for further replies.
Feb 19, 2002
363
GB
I have a cell in Excel with 20 characters eg ABKHLHABLJKHJABOPIJUIUABPIJUIAB

I want to find out how many times "AB" occurs in 1 cell only

searched through the functions but couldn't find anything suitable

Any hints would be greatly appreciated

"Work to live, don't live to work"

"The problem with troubleshooting is that sometimes it shoots back"
 
Assuming that the string is in cell A1, this can be calculated with:

=(LEN(A1)-LEN(SUBSTITUTE(A1,"AB","")))/2

combo
 
this works perfectly thanks a lots and have a STAR on me as well

"Work to live, don't live to work"

"The problem with troubleshooting is that sometimes it shoots back"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top