Count specific character in text string

A

Alex Burman

I know this can be done, but I've forgotten. What is the formula to count
the number of, for example, the letter "d" in a text string in a cell?

Also, I have imported a list of path and file names into Excel. Is there a
formula/function that will allow me to display the file name and remove the
path. e.g.

c:\temp\asg\123\text file.doc to text file.doc

I would like it to be a cell formula rather than using "text to columns".

Many thanks, Alex
 
J

JE McGimpsey

One way:

=MID(A1, FIND("^", SUBSTITUTE(A1, "\", "^", LEN(A1) -
LEN(SUBSTITUTE(A1, "\", "")))) + 1, 255)
 
A

Alex Burman

Perfect, Thanks v much to you both.
JE McGimpsey said:
One way:

=MID(A1, FIND("^", SUBSTITUTE(A1, "\", "^", LEN(A1) -
LEN(SUBSTITUTE(A1, "\", "")))) + 1, 255)
columns".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top