Trim & Right Functions

D

Dominique Feteau

I have this formula which will look for the "," in F31 and display
everything to the right of it:

=TRIM(RIGHT(F31,LEN(F31)-FIND(",",F31)))

Can this formula be tweaked to look for a "#" or a text string using "OR"
statements?

let me know
niq
 
K

Kent

niq:

It can get ugly quick. For example:

=IF(ISERROR(FIND(",",F31)),IF(ISERROR(FIND
("#",F31)),F31,TRIM(RIGHT(F31,LEN(F31)-FIND
("#",F31)))),TRIM(RIGHT(F31,LEN(F31)-FIND(",",F31))))

will test in precedence for comma, pound, and if none will
leave it alone.

Excel Support Technician
www.canhelpyou.com
-----------------------------------------------------------
 
D

Dominique Feteau

Thanks Kent but I found an easier way to do what I needed. I used Tools ->
Text to Columns and it did exactly what I needed. I had to tweak it a
little, but it worked perfectly in the end.

Thanks for your help

Niq
 
K

Kent

Funny ... I went that route to and then decided the "_"
words would be all over the place. I should have asked
about your data pattern ;^)
 

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