search
HomeTopicsexcelExample parsing Excel: Split names mixed in the same cell into one column

本篇文章给大家带来了关于excel的相关知识,其中主要介绍了关于如何把混合在同一单元格中的姓名拆分成一列的相关内容,下面一起来看一下,希望对大家有帮助。

Example parsing Excel: Split names mixed in the same cell into one column

相关学习推荐:excel教程

如何把混合在同一单元格中的姓名拆分成一列。

先看数据源和最终效果:

Example parsing Excel: Split names mixed in the same cell into one column

远古青年:

D2单元格输入公式,下拉到出现空白为止。

太长了,左右拖动滑块,可查看完整公式~~

=TRIM(MID(SUBSTITUTE(B$2&"、"&B$3&"、"&B$4&"、"&B$5&"、"&B$6&"、"&B$7&"、"&B$8&"、"&B$9,"、",REPT(" ",199)),ROW(A1)*199-198,199))

Example parsing Excel: Split names mixed in the same cell into one column

公式的意思是先把各个单元格中的字符连接到一起,然后将每个间隔符“顿号”都替换成199个空格,这样就相当于拉大了各个姓名之间的间隔距离(和做核酸类似,越远越好~~)

然后使用MID函数在第1、第199、第398……个字符处,提取出199个字符。这些字符是包含姓名和多余空格的,所以最后用TRIM函数去掉多余空格。

这个公式的缺点就是太长了,数据行数多了还可能会出问题,优点是可以在任意Excel版本中使用。

近代青年:

单击数据区域任意单元格,在【数据】选项卡下单击【来自表格/区域】,将数据加载到数据查询编辑器里。

右键删除部门列(如有需要可保留)。

单击姓名列,选择【拆分列】→【按分隔符】,此时Excel会自动分析咱们的数据,并给出拆分建议。

选择【高级选项】→【拆分到行】

最后【关闭并上载】到工作表里。

Example parsing Excel: Split names mixed in the same cell into one column

此方法适合在Excel 2016及以上版本中使用,使用2010、2013版本的小伙伴,通过安装Power Query插件也可以实现。

现代青年:

D2单元格输入以下公式,按回车:

=TEXTSPLIT(CONCAT(B2:B9&"、"),,"、")

Example parsing Excel: Split names mixed in the same cell into one column

这个公式简单明了,而且运算效率高。美中不足的是目前仅允许安装了Office 365并且加入Office 预览体验计划的小伙伴使用。

TEXTSPLIT函数的作用是按照特定的分隔符拆分字符串。

写法是这样的:

TEXTSPLIT(文本,列分隔符,[行分隔符],[是否忽略空值],[填充文本])。

本例中省略了最后两个参数。

先使用CONCAT(B2:B9&”、”),把B2:B9单元格的内容连接到一起,每个单元格之间用逗号隔开,得到的结果作为待拆分的字符串。

然后使用TEXTSPLIT函数将连接后的字符串按顿号拆分成一列显示。

如果希望将数据拆分成一行显示,公式可以换成这样:

=TEXTSPLIT(CONCAT(B2:B9&"、"),"、")

相关学习推荐:excel教程

The above is the detailed content of Example parsing Excel: Split names mixed in the same cell into one column. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Excel Home. If there is any infringement, please contact admin@php.cn delete
MEDIAN formula in Excel - practical examplesMEDIAN formula in Excel - practical examplesApr 11, 2025 pm 12:08 PM

This tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden

Google Spreadsheet COUNTIF function with formula examplesGoogle Spreadsheet COUNTIF function with formula examplesApr 11, 2025 pm 12:03 PM

Master Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han

Excel shared workbook: How to share Excel file for multiple usersExcel shared workbook: How to share Excel file for multiple usersApr 11, 2025 am 11:58 AM

This tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m

How to convert Excel to JPG - save .xls or .xlsx as image fileHow to convert Excel to JPG - save .xls or .xlsx as image fileApr 11, 2025 am 11:31 AM

This tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo

Excel names and named ranges: how to define and use in formulasExcel names and named ranges: how to define and use in formulasApr 11, 2025 am 11:13 AM

This tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo

Standard deviation Excel: functions and formula examplesStandard deviation Excel: functions and formula examplesApr 11, 2025 am 11:01 AM

This tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi

Square root in Excel: SQRT function and other waysSquare root in Excel: SQRT function and other waysApr 11, 2025 am 10:34 AM

This Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The

Google Sheets basics: Learn how to work with Google SpreadsheetsGoogle Sheets basics: Learn how to work with Google SpreadsheetsApr 11, 2025 am 10:23 AM

Unlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate

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

Dreamweaver CS6

Dreamweaver CS6

Visual web development 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.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Atom editor mac version download

Atom editor mac version download

The most popular open source editor