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 convert number to text in Excel - 4 quick waysHow to convert number to text in Excel - 4 quick waysMay 15, 2025 am 10:10 AM

This tutorial shows how to convert numbers to text in Excel 2016, 2013, and 2010. Learn how to do this using Excel's TEXT function and use numbers to strings to specify the format. Learn how to change the format of numbers to text using the Format Cell… and Text to Column options. If you use an Excel spreadsheet to store long or short numbers, you may want to convert them to text one day. There may be different reasons to change the number stored as a number to text. Here is why you might need to have Excel treat the entered number as text instead of numbers: Search by part rather than the whole number. For example, you might want to find all numbers containing 50, such as 501

How to make a dependent (cascading) drop-down list in ExcelHow to make a dependent (cascading) drop-down list in ExcelMay 15, 2025 am 09:48 AM

We recently delved into the basics of Excel Data Validation, exploring how to set up a straightforward drop-down list using a comma-separated list, cell range, or named range.In today's session, we'll delve deeper into this functionality, focusing on

How to create drop down list in Excel: dynamic, editable, searchableHow to create drop down list in Excel: dynamic, editable, searchableMay 15, 2025 am 09:47 AM

This tutorial shows simple steps to create a drop-down list in Excel: Create from cell ranges, named ranges, Excel tables, other worksheets. You will also learn how to make Excel drop-down menus dynamic, editable, and searchable. Microsoft Excel is good at organizing and analyzing complex data. One of its most useful features is the ability to create drop-down menus that allow users to select items from predefined lists. The drop-down menu allows for faster, more accurate and more consistent data entry. This article will show you several different ways to create drop-down menus in Excel. - Excel drop-down list - How to create dropdown list in Excel - From the scope - From the naming range

Convert PDF to Excel manually or using online convertersConvert PDF to Excel manually or using online convertersMay 15, 2025 am 09:40 AM

The PDF format, known for its ability to display documents independently of the user's software, hardware, or operating system, has become the standard for electronic file sharing.When requesting information, it's common to receive a well-formatted P

How to convert Excel files to PDFHow to convert Excel files to PDFMay 15, 2025 am 09:37 AM

This short tutorial describes 4 possible ways to convert Excel files to PDF - using Excel's Save As feature, Adobe software, online Excel to PDF converter, and desktop tools. Converting an Excel worksheet to a PDF is usually necessary if you want other users to be able to view your data but can't edit it. You may also want to convert Excel spreadsheets to PDF format for use in media toolkits, presentations, and reports, or create a file that all users can open and read even if they don't have Microsoft Excel installed, such as on a tablet or phone. Today, PDF is undoubtedly one of the most popular file formats. According to Google

How to use SUMIF function in Excel with formula examplesHow to use SUMIF function in Excel with formula examplesMay 13, 2025 am 10:53 AM

This tutorial explains the Excel SUMIF function in plain English. The main focus is on real-life formula examples with all kinds of criteria including text, numbers, dates, wildcards, blanks and non-blanks. Microsoft Excel has a handful o

IF function in Excel: formula examples for text, numbers, dates, blanksIF function in Excel: formula examples for text, numbers, dates, blanksMay 13, 2025 am 10:50 AM

In this article, you will learn how to build an Excel IF statement for different types of values as well as how to create multiple IF statements. IF is one of the most popular and useful functions in Excel. Generally, you use an IF statem

How to sum a column in Excel - 5 easy waysHow to sum a column in Excel - 5 easy waysMay 13, 2025 am 09:53 AM

This tutorial shows how to sum a column in Excel 2010 - 2016. Try out 5 different ways to total columns: find the sum of the selected cells on the Status bar, use AutoSum in Excel to sum all or only filtered cells, employ the SUM function

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 Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Clair Obscur: Expedition 33 - How To Get Perfect Chroma Catalysts
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools