Argonous
New Member
- Joined
- Sep 23, 2004
- Messages
- 15
- Office Version
- 2019
- Platform
- Windows
Greetings Everyone,
I have a workbook with two sheets. The first contains over 7,000 unique values that relate to a location. The second contains a set of characters that everything to the right of needs to be removed from the original value (the suffix is what makes the original value unique). I need a formula that can take the suffix value from Sheet2 and remove it, and everything to the right of it, from the original value on Sheet1. An example of what I am trying to do is below, with the desired result in the Results column.
After searching for a bit, I found the following formula, but this requires an exact entry for every suffix in the list. This would require identifying each and every unwanted suffix, which is what I am trying to avoid.
Any suggestion on a edit to the above formula or a more efficient one that can be used?
Thanks all!
I have a workbook with two sheets. The first contains over 7,000 unique values that relate to a location. The second contains a set of characters that everything to the right of needs to be removed from the original value (the suffix is what makes the original value unique). I need a formula that can take the suffix value from Sheet2 and remove it, and everything to the right of it, from the original value on Sheet1. An example of what I am trying to do is below, with the desired result in the Results column.
After searching for a bit, I found the following formula, but this requires an exact entry for every suffix in the list. This would require identifying each and every unwanted suffix, which is what I am trying to avoid.
Excel Formula:
=TRIM(SUBSTITUTE(A14,TRIM(IFERROR(LOOKUP(1E+100,SEARCH(Sheet2!$A$1:$A$22,A14,1),Sheet2!$A$1:$A$22),"")),""))
Any suggestion on a edit to the above formula or a more efficient one that can be used?
Thanks all!
Sheet1
Full Location | Result |
---|---|
3A1114-01 | 3A1114 |
3A1114-02 | 3A1114 |
3A1116-INS | 3A1116 |
3A1120CONF | 3A1120 |
3A2106LABTRK-01 | 3A2106 |
3A2106LABTRK-02 | 3A2106 |
HP252macSR | HP252 |
HP254macINS | HP254 |
HP254mac01 | HP254 |
HP254mac02 | HP254 |
3C205DECOM | 3C205 |
3E1100-CNC1 | 3E1100 |
3E1100-CNC2 | 3E1100 |
3E2103A-01 | 3E2103A |
3E2103A-02 | 3E2103A |
Sheet2
Remove to the Right of This |
---|
- |
LABTRK |
mac |
CONF |
DECOM |