Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InStr Function? - Please Help ASAP

Status
Not open for further replies.

strom99

MIS
Joined
Nov 28, 2000
Messages
126
Location
US
I have the following 3 formulas to break up a description field and superscript the TM symbol. How do account for fields that don't have a "(TM)" symbol, the formula returns an error if it is not there?

Thanks

Formula 1:
left({string},instr({@string},"(TM)")-1)

Formula 2:
mid({string},instr({@string},"(TM)"),5)

Formula 3:
mid({string},instr({@string},"(TM)")+4)
 
You need a simple IF-THEN statement asking IF InStr({MyString},"TM") returns 0 THEN MyString

InStr returns a positional based integer. If str2 is not found in str1, the InStr function returns 0
 
Can you please help a little further, I am not getting this work, it looks like i need an instr function for each of the 3 formulas
 
In the beginning of each formula use:

If instr({@string},"(TM)")>0 then
original formula
Else
Whatever you want if the (TM) isn't presentd Mike

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top