Excel:SUM操作之前将公式应用于每个单元格 [英] Excel: apply formula to each cell before SUM operation

查看:79
本文介绍了Excel:SUM操作之前将公式应用于每个单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对一定范围的单元格进行求和,但不是像IS那样使用单元格中的值,而是需要从每个单元格中提取一个片段以用于求和.在下面的示例中,我需要在-号之前使用该值.

I am trying to do a SUM on a range of cells but instead of using the value in the cell as IS I need to extract a piece from each cell to use in the sum. In the example below I need to use the value before the - sign.

   A
1  1-3
2  2-60
3  5-3
4  =SUM(A1:A3)

SUM应该是第一部分的加法(在-之前),所以1 + 2 + 5

SUM should be the addition of the first piece (before the -) so 1 + 2 + 5

我找到了一种使用提取数据的方法

I found a way to extract the data by using

=LEFT(A1, SEARCH("-",A1,1)-1) = 1
=LEFT(A2, SEARCH("-",A2,1)-1) = 2
=LEFT(A3, SEARCH("-",A3,1)-1) = 5

但是如何在不使用任何其他单元格的情况下求和这些公式的值?

But how can I SUM the value of these formulas without having to use any more additional cells?

推荐答案

使用数组公式:=SUM(VALUE(LEFT(A1:A3, SEARCH(A1:A3, "-")-1))).然后按Shift-Ctrl-Enter告诉Excel这是一个数组公式.

Use an array formula: =SUM(VALUE(LEFT(A1:A3, SEARCH(A1:A3, "-")-1))). Then press Shift-Ctrl-Enter to tell Excel this is an array formula.

这篇关于Excel:SUM操作之前将公式应用于每个单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆