ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Find Function (https://www.excelbanter.com/excel-worksheet-functions/197122-find-function.html)

Jeff Gross

Find Function
 
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?



yshridhar

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

"Jeff Gross" wrote:

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?



Jeff Gross

Find Function
 
That did it - thanks a lot.

Jeff

"yshridhar" wrote:

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

"Jeff Gross" wrote:

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?



yshridhar

Find Function
 
you are most welcome. thanks for your feedback

"Jeff Gross" wrote:

That did it - thanks a lot.

Jeff

"yshridhar" wrote:

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

"Jeff Gross" wrote:

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?



Jeff Gross

Find Function
 
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

"yshridhar" wrote:

you are most welcome. thanks for your feedback

"Jeff Gross" wrote:

That did it - thanks a lot.

Jeff

"yshridhar" wrote:

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

"Jeff Gross" wrote:

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?




All times are GMT +1. The time now is 11:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com