We help IT Professionals succeed at work.
Get Started

Find X occurrence of a character withing a text cell in Excel

jana
jana asked
on
84 Views
Last Modified: 2017-12-13
Please advice correct formula to know the position or the occurrence of a specific character within an excel cell.

For example in the cell contents "Oh why? Is there any hope? Please, oh Please, Thanx!" (see pix below), we want to find the position of the 4th character "e".  It should be in the 41th position.

excel screen of contenst to search in with columns
The formulas working with are:
=FIND(C5,B3,FIND(C5,B3)+D5)
=SEARCHB(C5,B3,(SEARCHB(C5,B3,(SEARCHB(C5,B3,1)+1))+1))
=FIND(CHAR(1),SUBSTITUTE(B3,C5,CHAR(1),3))
=FIND(C5,B3, FIND(C5,B3)+3)

Open in new window


The first works if we want to find the 2nd or 3rd  occurrence of "e", but the 4th, 5th, etc., doesn't work.
(also if we want to find "?" or "," or ".", or "!" also doesn't return the correct position)

Please advice on the correct formula to find within a text cell any position of any character.

Thank you in advance.
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2016
Commented:
This problem has been solved!
Unlock 1 Answer and 6 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE