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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get all but last 3 charactes of cell only IF TQ at end of field 1

Status
Not open for further replies.

debbiepy

MIS
Jan 19, 2005
43
US
I have data in a cell:

MSD AutoCAD Electrical 2007 Trial CD
PTD AutoCAD 2007 Download Trial TQ

I only want the data up to the TQ. I tried this formula

If cell ends with TQ get me len(cell)-3

How do I right this formula

I tried

=if(right(len(cell)="q",left(cell,len(cell)-3),cell))

but it didn't work

any help
 
I figured it out

=IF(RIGHT(AF2,LEN(AF2)-(LEN(AF2)-1))="q",LEFT(AF2,LEN(AF2)-3),AF2)
 
The first bit of your formula is unnecessarily complex. Try:
=IF(RIGHT(AF2,1)="q",LEFT(AF2,LEN(AF2)-3),AF2)


Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top