[英]Excel: How to add only the values from one cell, skipping other text and characters?
I have values such as below in one single cell E2 in excel.
我在excel中的一个单元格E2中具有以下值。 How do I skip the paranthesis, space and the text that is there in the cell and add only the values enclosed within the brackets and show the result in D2?
如何跳过单元格中的括号,空格和文本,仅添加方括号内的值,并在D2中显示结果? (5) text (5) text (5) text (10) text (10) text (15) text (10) text (10) text (20) text (10) text
(5)文本(5)文本(5)文本(10)文本(10)文本(15)文本(10)文本(10)文本(20)文本(10)文本
I've attached an image to show an idea of how it looks. 我已附上一张图片,以显示其外观。
=SUBSTITUTE(TRIM(SUBSTITUTE(SUBSTITUTE(TRIM(SUBSTITUTE(A1,"text"," ")),"(",""),")",""))," ","")
另一个,
=SUMPRODUCT(--REPLACE(A1:A10, FIND(" ", A1:A10), LEN(A1:A10), TEXT(,)))
If given input string is well formatted, I can extract the number with excel function. 如果给定的输入字符串格式正确,则可以使用excel函数提取数字。
=value(MID(F1,FIND("(",F1)+1,FIND(")",F1)-FIND("(",F1)-1))
This function is composed of 3 elemental functions. 该功能由3个基本功能组成。
=value(MID( F1 , FIND("(",F1)+1 , FIND(")",F1)-FIND("(",F1)-1 ))
F1: we want to extract the number from this
FIND("(",F1)+1 : where the number start from
FIND(")",F1)-FIND("(",F1)-1 : calculates the length of the number
MID:extract a string
value :deal(cast) a string as a number
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.