Hello,
I'd like assistance with figuring out how to determine the name of a carrier based on how the first few characters of a tracking ID begin with. The problem is some characters can instantly identify a carrier by the first character and other can be identified by 2 or 3 characters.
Lastly, if none of the criteria match, instead of outputting an N/A value, I'd prefer it to default to "FedEx".
The source data is column C "Tracking ID"
Columns H:I is a named range to be used in the function, entitled "CARRIER_TBL"
Column A "Carrier" is the intended output.
Observe how Lasership can be identified as either "1LS" or "LS", and
UPS can be identified with either "1Z" or "Z"
Lastly, "FedEx" was the correct output when the tracking ID for C8 could not be found (because FedEx has so many different variations to their tracking IDs, this is the preferred catch-all method)
I'd like assistance with figuring out how to determine the name of a carrier based on how the first few characters of a tracking ID begin with. The problem is some characters can instantly identify a carrier by the first character and other can be identified by 2 or 3 characters.
Lastly, if none of the criteria match, instead of outputting an N/A value, I'd prefer it to default to "FedEx".
The source data is column C "Tracking ID"
Columns H:I is a named range to be used in the function, entitled "CARRIER_TBL"
Column A "Carrier" is the intended output.
Observe how Lasership can be identified as either "1LS" or "LS", and
UPS can be identified with either "1Z" or "Z"
Lastly, "FedEx" was the correct output when the tracking ID for C8 could not be found (because FedEx has so many different variations to their tracking IDs, this is the preferred catch-all method)
Book1 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | Carrier | Tracking ID | CARRIER_TBL | ||||||||
2 | Lasership | 1LS563210865342 | 1LS | Lasership | |||||||
3 | Lasership | LS720841130957 | LS | Lasership | |||||||
4 | UPS | 1ZE336250366090349 | 1Z | UPS | |||||||
5 | UPS | ZE336250366090349 | Z | UPS | |||||||
6 | United Delivery Service | WM6280000000919759 | C | OnTrac | |||||||
7 | OnTrac | C11659806311237 | WM | United Delivery Service | |||||||
8 | FedEx | 429154527459 | |||||||||
Sheet2 |
Last edited: