Excel

Split a policy number without a helper column

Text to Columns rewrites the source. A helper column full of LEFT and FIND is hard to reread six months later. On Microsoft 365, three functions do the split and leave the original cell alone.

Say A2 contains CGL-2026-00418.

One piece at a time

The text before the first dash:

=TEXTBEFORE(A2, "-")

That returns CGL.

The text after the last dash. The -1 means “the last time this delimiter appears”:

=TEXTAFTER(A2, "-", -1)

That returns 00418.

If the delimiter might be missing, pass a final argument so the cell stays readable:

=TEXTAFTER(A2, "-", -1, , , "No dash in this cell")

All the pieces at once

TEXTSPLIT spills each piece into its own cell, starting at the formula and moving right:

=TEXTSPLIT(A2, "-")

You get CGL, 2026, and 00418. Leave empty cells to the right of the formula or the spill will show #SPILL!.

A warning for shared workbooks

Anyone who opens the file in Excel 2016 or 2019 will see #NAME?. If the workbook has to travel to an older Excel, do the split with Power Query, or stay with a Table and TEXTSPLIT only in a Microsoft 365 copy you control.

Try this today

Take one cell that looks like CGL-2026-00418 and return the prefix, the year, and the last segment into three cells with TEXTSPLIT.

TEXTBEFORE, TEXTAFTER, and TEXTSPLIT are Microsoft 365 functions. They are not in Excel 2016 or Excel 2019.

More Excel tips