简体   繁体   English

Excel公式-提取单元格中的特定数据

[英]Excel Formula - Extracting specific data in a cell

I need to be able to extract a specific Figure from a cell but it does not always appear in the same place in the cells. 我需要能够从单元格中提取特定的图形,但是它并不总是出现在单元格中的同一位置。

the data in the cells appears in different formats and i have three examples below 单元格中的数据以不同的格式出现,我下面有三个示例

(24M UNLTD 10GB £29+£20 S1) (24M UNLTD+INS 30GB £34+£30 S6) (12M SIMO 1GB £15 S1) (24M UNLTD 10GB£29 +£20 S1)(24M UNLTD + INS 30GB£34 +£30 S6)(12M SIMO 1GB£15 S1)

In the first two examples i need to pull the first £ figure and not the second and in the third example i need to pull the only £ figure. 在前两个示例中,我需要拉出第一个£数字,而在第二个示例中,我需要拉出唯一的£数字。

I would like a single formula that can pull the data but if, not it is possible to separate the data by the first 3 characters in the cell so i can use two separate formulas. 我想要一个可以提取数据的公式,但如果不能,则可以用单元格中的前三个字符分隔数据,因此我可以使用两个单独的公式。

you may use something like: 您可以使用类似:

=MID(A1,FIND("£",A1),MIN(IF(ISERROR(MID(MID(A1,FIND("£",A1)+1,999),ROW($1:$999),1)+0)*(MID(MID(A1,FIND("£",A1)+1,999),ROW($1:$999),1)<>"."),ROW($1:$999),999)))

if there is never a number with decimal point then using 如果从不存在带小数点的数字,则使用

=MID(A1,FIND("£",A1),MIN(IF(ISERROR(MID(MID(A1,FIND("£",A1)+1,999),ROW($1:$999),1)+0),ROW($1:$999),999)))

will do it too 也会做

The formulas are array-formulas and must be confirmed with Ctrl + Shift + Enter . 公式是数组公式,必须使用Ctrl + Shift + Enter确认

You may also try this: 您也可以尝试以下方法:

=IF(ISNUMBER(SEARCH("+",A1)),MID(A1,SEARCH("£",A1)+1,SEARCH("+",A1,SEARCH("£",A1))-SEARCH("£",A1)-1),MID(A1,SEARCH("£",A1)+1,SEARCH(" ",MID(A1,SEARCH("£",A1)+1,999),1)-1))

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM