Spreadsheet data

How to remove last N characters in Excel

2026-06-28
Task

A supplier file adds a three-letter warehouse suffix to each SKU: 00123CAL, 00456NYC, 07890TEX. The import needs the clean SKU without the last 3 characters: 00123, 00456, 07890.

Short answer

Create sku_clean from sku_raw and add one rule: condition Regular expression with .{3}$, action Remove substring.

How to do it in Eofferix

  1. Upload the CSV or XLSX file with the sku_raw column where the last 3 characters are always a service code.

  2. Create the result column sku_clean from the source column sku_raw.

  3. Open the settings for sku_clean with the gear icon in its header.

    Opening sku_clean column settings for removing trailing characters
    The preview shows 00123CAL becoming 00123.
  4. In Transformations, choose Regular expression, enter .{3}$, and set the action to Remove substring.

    Eofferix rule for removing the last three characters from SKU values
    The pattern .{3}$ finds the last 3 characters at the end of the string, and the action removes that match.
  5. Save the settings and check several rows: 00456NYC should become 00456, and 07890TEX should become 07890.

Before / after

Before

source data
sku_rawproduct
00123CALHudson desk lamp
00456NYCMaple wall shelf
07890TEXTrail travel mug

After

result
sku_cleanproduct
00123Hudson desk lamp
00456Maple wall shelf
07890Trail travel mug

What to keep in mind

  • Use this method when the extra suffix has the same length in every row.
  • If the suffix is separated by a character, such as 00123-CAL, use the remove-text-after-character case instead.
  • Change the number for another length: .{2}$ removes the last 2 characters, and .{4}$ removes the last 4.

Process data faster with Eofferix

Create a free account to automate catalogs and price lists around your own rules.

Sign up