SKU in A2 looks like US-WIDGET-0042. Extract the market, product, and number

公式

=TEXTSPLIT(A2, "-")

说明

TEXTSPLIT spills market, product, and number across columns. On Excel 2016 combine LEFT, MID, RIGHT with FIND.

步骤

  1. Identify the delimiter (-).
  2. TEXTSPLIT (365) returns every part.
  3. Otherwise nest FIND to locate each hyphen.

变体

Market (Excel 2016)

Characters before the first hyphen.

=LEFT(A2, FIND("-", A2)-1)

Trailing code (Excel 2016)

Replaces the second hyphen with a marker, then takes the tail.

=RIGHT(A2, LEN(A2)-FIND("@", SUBSTITUTE(A2, "-", "@", 2)))

Fixed-width MID

Use when every SKU shares the same character positions.

=MID(A2, 4, 6)