Trim Barcode

Hi Everyone,
I am trying to remove excess information from barcodes. Scanning a couple of items has came back with information like this:

CATAA( โ€“ 6I0273
CATAA --3261643
CATAA: โ€“ 1R0778
CATAAPHโ€“3375270

So โ€œCATAAโ€ is a constant among them, โ€œ(โ€ or โ€œPHโ€ is the โ€œoriginโ€ of the product.
The numbers on the right are the actual part number that I care about.

I would like to create an expression that fills in [Part Number] based off of [Barcode]
Iโ€™ve looked into SPLIT and TRIM, but because the โ€œOriginโ€ is very often different im unsure how to consistently remove everything left of the part number.

Thanks

0 4 782
4 REPLIES 4

Is the part you are interested in always delimited by a โ€œ-โ€œ? If yesโ€ฆ you can try a combination of Find() and Right() to leave you with the part you want. See some information here:

Yeah I found something very similar in appsheets examples:

Column AppName with a value of โ€œSales-10305โ€

LEFT([AppName], FIND("-", [AppName]))** returns โ€œSalesโ€

This works for the most part for me. My current formula is:

IFS(Contains([Barcode],โ€œCATโ€),
RIGHT([Barcode], FIND("โ€“",SUBSTITUTE([Barcode], " ", โ€œโ€))),

Contains([Barcode],โ€œ742330โ€),
โ€œP5โ€,

AND(Contains([Barcode],โ€œPโ€),Contains([Barcode],"-"),LEN([Barcode]) = 15),
LEFT([Barcode], FIND("-", [Barcode]) - 1)
)

With the CAT section I am sometimes left with a space on the left of the part number.

Any Ideas?

Wrap your entire expression in TRIM().

Well I guess itโ€™s just that easy!

Thank you! @Steve

Top Labels in this Space