psycoperl
Active Member
- Joined
- Oct 23, 2007
- Messages
- 339
- Office Version
- 365
- 2016
- Platform
- Windows
- MacOS
- Web
I am trying to clean up for sorting purposes class catalog #s. To that end, I want to remove any non numeric characters that are at the end of these numbers. For example 2006L should be just 2006, and 2610 would be 2610. Values can range from 1 to 5 characters in length. I tried to use the following formula
however it would remove the last character if it was also a digit.
For example 9900 became 990, 9901 became 990, 9902 became 990 also.
Where did I go wrong in the formula?
Excel Formula:
=IF(ISNUMBER(RIGHT(TRIM(E240),1)),TRIM(E240),LEFT(TRIM(E240),LEN(TRIM(E240))-1))
For example 9900 became 990, 9901 became 990, 9902 became 990 also.
Where did I go wrong in the formula?
Book1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
C | D | E | I | ||||||
238 | BAR01 | MTH | 9902 | 990 | |||||
239 | BAR01 | MTH | 9903 | 990 | |||||
240 | BAR01 | MTH | 122L | 122 | |||||
241 | BAR01 | MTH | 123L | 123 | |||||
242 | BAR01 | MTH | 132L | 132 | |||||
243 | BAR01 | MTH | 150B | 150 | |||||
244 | BAR01 | MTH | 2002T | 2002 | |||||
245 | BAR01 | MTH | 2006L | 2006 | |||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
I238:I245 | I238 | =IF(ISNUMBER(RIGHT(TRIM(E238),1)),TRIM(E238),LEFT(TRIM(E238),LEN(TRIM(E238))-1)) |