My work uses a program that only allows our product descriptions to be 50 characters. The descriptions we get are from the original manufacturers. My job (among other things) is to trim the OEM descriptions to less than 50 characters.
The catch to this is that I need to keep the "# P/CS PRICE" - where # could be anything from 2 to 9999 - that I append to the description.
Also when the description is trimmed to 50 characters I don't want it to cut a word in half. So basically it has to include all of a word or none of it.
I have a formula that allows me to trim the description down to what I need except it cuts words. If the cell doesn't end in the appended "# P/CS PRICE" the formula will just trim the description from the left. This is what I have (A1 is the description):
=IF(RIGHT(A1,10)="P/CS PRICE",SUBSTITUTE((LEFT(LEFT(A1,(LEN(A1)-16+FIND(" ",RIGHT(A1,16),1))-1),50-17+(FIND(" ",RIGHT(A1,16),1))))&(RIGHT(A1,17-(FIND(" ",RIGHT(A1,16),1))))," "," "),LEFT(A1,50))
A1= 1.5"FLUSH MNT RET/WATER BAR W ORIFICE 250 P/CS PRICE
After formula=1.5"FLUSH MNT RET/WATER BAR W ORIFI 250 P/CS PRICE
It cuts the word "ORIFICE" to "ORIFI". I'd like it to recognize that it can't include the whole word in the description so it should just omit it. Like so:
1.5"FLUSH MNT RET/WATER BAR W 250 P/CS PRICE
I have to edit 1000's of these descriptions in a day so any ideas or help would be very appreciated!
Bookmarks