Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 有没有办法从单元格中提取特定字符串?_Regex_Google Sheets_Array Formulas_Google Sheets Query_Google Query Language - Fatal编程技术网

Regex 有没有办法从单元格中提取特定字符串?

Regex 有没有办法从单元格中提取特定字符串?,regex,google-sheets,array-formulas,google-sheets-query,google-query-language,Regex,Google Sheets,Array Formulas,Google Sheets Query,Google Query Language,我试图提取某个子字符串圆括号之间的值,该子字符串是由,分隔的字符串的一部分,然后添加所有这些值 例如: Cell A1 : Text4(5),Text1(7) Cell A2 : Text1(2) Cell A3 : Text1(1),Text4(3),Text6(5) Cell A1 : Text1(4) Cell B1 : Text1 Cell A2 : Text3(2) Cell A3 : Text1(6) 在本例中,通过搜索Text1,它获得值4和6,并显示结果10 =SUM(AR

我试图提取某个子字符串圆括号之间的值,该子字符串是由
分隔的字符串的一部分,然后添加所有这些值

例如:

Cell A1 : Text4(5),Text1(7) Cell A2 : Text1(2) Cell A3 : Text1(1),Text4(3),Text6(5) Cell A1 : Text1(4) Cell B1 : Text1 Cell A2 : Text3(2) Cell A3 : Text1(6) 在本例中,通过搜索Text1,它获得值4和6,并显示结果10

=SUM(ARRAYFORMULA(VALUE( REGEXEXTRACT( SPLIT( QUERY(A1:A3,"select A where A contains '"&B1&"'") ,",") ,"[\[\(](.*)[\)\]]")))) =总和(数组)公式(值( 正则抽取( 分裂( 查询(A1:A3,“选择A中包含“'”和B1&“')) ,",") ,"[\[\(](.*)[\)\]]")))) 但是当字符串中有更多元素时,我不知道如何获取值。尝试在内部进行另一个查询,但没有成功

=ARRAYFORMULA(SUM(REGEXEXTRACT(QUERY(TRANSPOSE(SPLIT(TEXTJOIN(",", 1, A1:A), ",")), 
 "where Col1 contains 'Text1'", 0), "\((\d+)\)")*1))