[英]Extract data separated by a comma from a single cell
I have a spreadsheet with data relating to meetings . 我有一个包含会议数据的电子表格。 One of the cells has the name of meetings with the amount of participants under brackets as follows.
其中一个单元格具有会议名称,括号内的参与者数量如下。
Staff meeting (65), HR meeting (15), Pension meeting (4) 员工会议(65),人力资源会议(15),养老金会议(4)
There can be in between 1 to 9 meetings in a single cell. 在一个单元格中可以有1到9个会议。 I am looking for a way to extract each meeting name and number (all information between commas) in separate cells.
我正在寻找一种方法来提取单独的单元格中的每个会议名称和编号(逗号之间的所有信息)。
Does anyone know how can this be done? 有谁知道怎么做?
Select the column with the meetings. 选择包含会议的列。
Then select Text to Columns
on the Data tab of the Ribbon. 然后在功能区的“数据”选项卡上选择“
Text to Columns
”。
Choose 'Delimited' and the 'Comma' as the separator. 选择“分隔”和“逗号”作为分隔符。
Excel is not very good at recursive programming with cell storage. Excel不太擅长使用单元存储进行递归编程。
The solution can be solved with 6 different formulas copied on a number of lines. 该解决方案可以通过在多行上复制的6种不同的公式来解决。 In this example:
在这个例子中:
The formulas are:
- in B2: =FIND(",",A$1,B1+1)
- in C2: =MID(A$1,B1+1,B2-B1-1)
- in D2: =FIND("(",C2)
- in E2: =FIND(")",C2)
- in F2: =MID(C2,1,D2-1)
- in G2: =MID(C2,D2+1,E2-D2-1)
These cells can be copied to the next lines without adaptation, because the line of A$5 is vertically anchored. 可以将这些单元格复制到下一行而不进行调整,因为A $ 5的行是垂直锚定的。
Explanation: 说明:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.