gpt4 book ai didi

excel - 公式中的"Non-contiguous"范围说明

转载 作者:行者123 更新时间:2023-12-02 12:09:17 24 4
gpt4 key购买 nike

[2018-08-01:在帖子底部附近查看新 Material 。]

我只是遇到了一个Q-n-A here,其中包括一个使用我从未见过的规范引用范围的函数的示例。我试了一下,发现使用这种类型的引用时,大多数Excel函数将返回一个值:

=SUM(A1:A5:C1:C5:E1:E2:F3:F4)

注意其中的所有“:”。

使用光标在编辑栏中,突出显示那些不连续的单元格,即 ,就像一样,仅对那些单元格求和。但是,当我进行实验时,我发现它等效于以下公式:
=SUM(A1:F5)

但是,此公式符合我的期望:
=SUM(A1:A5,C1:C5,E1:E2,F3:F4)

示例:我将范围A1:F5定义为:
--  A   B   C   D   E   F1   1   2   3   4   5   62   2   4   6   8   10  123   3   6   9   12  15  184   4   8   12  16  20  245   5   10  15  20  25  30 

The formula results are:

=SUM(A1:F5) is 315

=SUM(A1:A5:C1:C5:E1:E2:F3:F4) is 315

=SUM(A1:A5,C1:C5,E1:E2,F3:F4) is 117

This illustrates my point that the first two seem to be equivalent, and the third "correct" way of defining a discontiguous range gives a different result (but what I would expect).

I looked around here and elsewhere on the Internet and found no relevant discussion.

So, my questions:

  1. Is that odd range reference of any real use?
  2. is it really a valid sort of range reference?

[New material 2018-08-01]

@YowE3K wondered what would happen with an odd number of cells. Here is my example:

--  A   B   C  1   1   1   1   2   1   1   1   3   1   1   1   4   1   1   1   

Now, in a faraway cell, I enter this formula:

=SUM(A1:B3:$C$2)

然后,如果我拖动公式,它会产生有趣的结果,基本上是3行2列范围扩展到始终包含固定单元格的矩形范围。在此示例中,您可以获得的最小总和为3。尝试一下,看看。

这显示出一些有用的东西,尽管我还没有提出具体的用途。

最佳答案

  • 该奇数范围引用是否有任何实际用途? <-是的。根据您正在处理的数据结构,您可能无权在工作表中添加额外的行/列。
  • 真的是有效的范围引用吗? <---既然可以,是的。无论是否正确记录。祝贺您的发现。我也在学习新事物。 (:
  • 关于excel - 公式中的"Non-contiguous"范围说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41653917/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com