Excel SUMIF函数用于还包含一些文本值的单元格

时间:2014-02-20 11:21:25

标签: excel sumifs

我想计算A单元格内的值的总和,但不合适的是这些单元格还包含格式为

的文本
  logvitprob=-49.5

在文档内部也可以有空行,如下所示:

 logvitprob=-58.2467                        
 (TOP (DT The)(DT-R (NN company)(NN-R (VBD said)(VBD-R (IN that)(IN-R (DT the)(DT-R (NN number)(NN-R (IN of)(IN-R (NN access)(NN-R (NNS lines)(NNS-R (VBD dropped)(VBD-R (RB slightly)(RB-R (IN in)(IN-R (DT the)(DT-R (NN quarter)(NN-R (DT a)(DT-R (NN decline)(NN-R (VBD attributed)(VBD-R (TO to)(TO-R (JJ seasonal)(JJ-R (NNS fluctuations)))))))))))))))))))))                        

 logvitprob=-39.201                     
(TOP (IN For)(IN-R (DT the)(DT-R (NN year)(NN-R (RB however)(RB-R (NN access)(NN-R (NNS lines)(NNS-R (IN in)(IN-R (NN service)(NN-R (VBP have)(VBP-R (VBN increased)(VBN-R (CD 5.5)(CD-R (NN %)))))))))))))                     

 logvitprob=-83.0381                        
 (TOP (NNP Chairman)(NNP-R (NNP D.H.)(NNP-R (NNP Hibbard)(NNP-R (VBD said)(VBD-R (DT the)(DT-R (NN company)(NN-R (VBZ has)(VBZ-R (VBN set)(VBN-R (DT a)(DT-R (JJ new)(JJ-R (CD five)(CD-R (NN year)(NN-R (NN goal)(NN-R (IN of)(IN-R (VBG doubling)(VBG-R (NNS revenues)(NNS-R (TO to)(TO-R (RB about)(RB-R (\$ \$)(\$-R (CD 1.8)(CD-R (CD billion)(CD-R (IN while)(IN-R (RB steadily)(RB-R (VBG increasing)(VBG-R (NN net))))))))))))))))))))))))))

 I could count the no of lines containing lovvit=smth with =COUNTIF(A1:A103976, "*logvitprob=*"), but how can I compute their sum? Many thanks!                     

1 个答案:

答案 0 :(得分:1)

logvitprob...值的右侧添加一列。写下这个公式:

=IFERROR(VALUE(RIGHT(A1,LEN(A1)-FIND("=",A1))),"")

现在您已经提取了您的值(假设您只在重要的单元格中有=符号),您可以将它们相加。