Find Function

J

Jeff Gross

I am using the following formula to search for a "<" in a cell and then trip
off all text after it is found:

=IF(FIND("<",C11,1)-1,(TRIM(LEFT(C11,FIND("<",C11,1)-1))),C11)

My intention is that if there is no "<", then just return what is in the
cell originally.

It trim part works but if there is no "<" in the cell, then I get a #Value
error.

Any ideas?
 
Y

yshridhar

=IF(isna(FIND("<",C11,1)),(TRIM(LEFT(C11,FIND("<",C11,1)-1))),C11)
best wishes
sreedhar
 
J

Jeff Gross

Actually it fixed the original problem but created a new one.

If there is not a "<", then the formula works properly. If there is a "<",
then the trim does not work.

Any ideas on rearranging the formula?

Jeff
 

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