search
HomeSoftware TutorialOffice SoftwareExcel: Split string by delimiter or pattern, separate text and numbers

This tutorial demonstrates how to efficiently split cells in Excel using both formulas and the advanced "Split Text" feature. Learn to separate text using commas, spaces, or any delimiter, and to split alphanumeric strings into their text and number components.

Splitting cell contents across multiple cells is a common Excel task. Previous articles covered the "Text to Columns" and "Flash Fill" methods. This tutorial focuses on formula-based solutions and the powerful "Split Text" tool.

  • Formula-Based Cell Splitting:
    • Separating text by comma, colon, slash, dash, or other delimiters.
    • Splitting text by line breaks.
    • Formulas for separating text and numbers.
  • Using the "Split Text" Tool:
    • Splitting cells by character.
    • Splitting cells by string.
    • Splitting cells by mask (pattern).

Splitting Text with Excel Formulas

Excel formula-based string splitting typically involves LEFT, RIGHT, MID, FIND, and SEARCH functions. While formulas might seem complex initially, the underlying logic is straightforward.

Splitting by Delimiter (Comma, Semicolon, etc.)

The core is identifying the delimiter's position using SEARCH (case-insensitive) or FIND (case-sensitive). Then, LEFT, RIGHT, or MID extract the relevant text segments.

Consider splitting "Item-Color-Size" SKUs into three columns:

Excel: Split string by delimiter or pattern, separate text and numbers

  1. Item Name (before the first hyphen): =LEFT(A2, SEARCH("-",A2,1)-1)
  2. Color (between hyphens): =MID(A2, SEARCH("-",A2) 1, SEARCH("-",A2,SEARCH("-",A2) 1) - SEARCH("-",A2) - 1)
  3. Size (after the last hyphen): =RIGHT(A2,LEN(A2) - SEARCH("-", A2, SEARCH("-", A2) 1))

Replace the hyphen ("-") with your desired delimiter (space, comma, etc.). Adjust " 1" and "-1" if your delimiter has more than one character.

Splitting by Line Break

Use CHAR(10) (line feed) to represent line breaks in formulas. Adapt the above formulas, replacing hyphens with CHAR(10).

Excel: Split string by delimiter or pattern, separate text and numbers

Splitting Text and Numbers

There's no universal solution for all alphanumeric strings. The optimal formula depends on the specific pattern.

'Text Number' Pattern:

Method 1: Count digits and extract. Use RIGHT to extract numbers and LEFT to extract text based on digit count.

Method 2: Find the first digit's position using MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A2&"0123456789")). Then, use LEFT and RIGHT for extraction.

'Number Text' Pattern:

Use LEFT to extract numbers (counting digits as above) and RIGHT to extract text.

Splitting Cells with the "Split Text" Tool

The "Split Text" tool (part of a suite like Ultimate Suite for Excel) offers a visual approach:

Splitting by Character: Splits at each occurrence of a specified character.

Excel: Split string by delimiter or pattern, separate text and numbers

Splitting by String: Splits using a combination of characters as delimiters.

Excel: Split string by delimiter or pattern, separate text and numbers

Splitting by Mask (Pattern): Splits based on a pattern, useful for complex scenarios.

Excel: Split string by delimiter or pattern, separate text and numbers

The "Split Text" tool significantly simplifies complex splitting tasks compared to formula-based methods.

Downloads:

Excel Split Cells formulas (.xlsx) Ultimate Suite trial (.exe)

The above is the detailed content of Excel: Split string by delimiter or pattern, separate text and numbers. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to do a running total in Excel (Cumulative Sum formula)How to do a running total in Excel (Cumulative Sum formula)Apr 21, 2025 am 11:16 AM

This concise guide demonstrates how to efficiently calculate running totals (cumulative sums) in Excel using a SUM formula with strategically placed absolute and relative cell references. A running total displays the accumulated sum of a dataset as

Excel LEN function: count characters in cellExcel LEN function: count characters in cellApr 21, 2025 am 10:10 AM

Are you looking for an Excel formula to count characters in a cell? If so, then you have certainly landed up on the right page. This short tutorial will teach you how you can use the LEN function to count characters in Excel, with or with

How to count words in Excel - formula examplesHow to count words in Excel - formula examplesApr 21, 2025 am 09:59 AM

This tutorial demonstrates how to count words in Excel using a combination of the LEN, SUBSTITUTE, and TRIM functions. It offers both case-sensitive and case-insensitive formulas for counting total words or specific words/text within a cell or range

Excel: Split string by delimiter or pattern, separate text and numbersExcel: Split string by delimiter or pattern, separate text and numbersApr 21, 2025 am 09:19 AM

This tutorial demonstrates how to efficiently split cells in Excel using both formulas and the advanced "Split Text" feature. Learn to separate text using commas, spaces, or any delimiter, and to split alphanumeric strings into their text

Excel Solver tutorial with step-by-step examplesExcel Solver tutorial with step-by-step examplesApr 21, 2025 am 09:15 AM

This tutorial explains how to locate and utilize the Solver add-in within various Excel versions, ranging from 2003 to 365. Step-by-step instructions and practical examples demonstrate Solver's application in optimizing solutions for linear programm

Excel Format Painter and other ways to copy formattingExcel Format Painter and other ways to copy formattingApr 20, 2025 am 10:29 AM

This tutorial demonstrates three efficient methods for copying formatting in Excel: Format Painter, Fill Handle, and Paste Special. These techniques are compatible with all Excel versions (2007-365). Proper formatting enhances worksheet presentation

Clear formatting in Excel: how to remove all formats in a cellClear formatting in Excel: how to remove all formats in a cellApr 20, 2025 am 10:12 AM

This tutorial offers two efficient methods for removing formatting from Excel spreadsheets. Dealing with extensive formatting in large spreadsheets can be cumbersome. These techniques streamline the process. Manually removing formatting is ineffici

Excel table: comprehensive tutorial with examplesExcel table: comprehensive tutorial with examplesApr 20, 2025 am 09:48 AM

This tutorial unveils the power of Excel tables, often overlooked yet incredibly efficient tools for data management. Discover how tables simplify tasks like dynamic named ranges, formula updates, and data formatting, saving you significant time and

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software