求最小值相应的列值 [英] Sum minimum of corresponding column values

查看:189
本文介绍了求最小值相应的列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两列数字。我想在一个单独的单元格中计算一个总和。总和将包括这两列中相应单元格的最小值。



示例:

 code> A | B 
--------
[1] 1 | 2
[2] 4 | 3
[3] 0 | 1
[4] 5 | 5

我需要一个公式,在单元格中计算1 + 3 + 0 + 5的总和其中

  * 1是MIN(A1,B1),
* 3是MIN(A2,B2)
* 0是MIN(A3,B3)
* 5是MIN(A4,B4)

这是否可以在一个公式中(独立于#rows)?



目前使用LibreOffice Calc,但Excel解决方案更受欢迎。

解决方案

您可以使用数组公式 Libre Office的文档,对于 Excel()):

  = SUM(IF(A1:A4< B1:B4,A1:A4 ,B1:B4))

确认由 Ctrl + Shift + 输入而不是简单的输入。


I have two columns with numbers. I would like to calculate in a separate cell a sum. The sum will include the minimums of corresponding cells in these two columns.

Example:

        A  |  B
       --------
[1]     1  |  2
[2]     4  |  3
[3]     0  |  1
[4]     5  |  5

I need a formula that would calculate in a cell the sum of 1 + 3 + 0 + 5 where

* 1 is the MIN(A1,B1), 
* 3 is the MIN(A2,B2) 
* 0 is the MIN(A3,B3)
* 5 is the MIN(A4,B4)

Is that possible in a single formula (independent of #rows)?

Working with LibreOffice Calc at the moment, but Excel solutions more than welcome.

解决方案

You can use an array formula (doc for Libre Office and for Excel) for this:

=SUM(IF(A1:A4<B1:B4, A1:A4, B1:B4))

Confirm by Ctrl+Shift+Enter instead of simple Enter.

这篇关于求最小值相应的列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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