使用嵌套的IF和AND数组公式确定中值 [英] Determining median values with nested IF and AND array formulas

查看:190
本文介绍了使用嵌套的IF和AND数组公式确定中值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建两个类似的数组公式:

I'm trying to create two similar array formulas:

一个是确定列(B)中单元格的中值,但只有在在列J中都是相应的空白值,列D中有数值。(D和J在不同的表格中。)

One is to determine the median value of the cells in a column (B), but only if there are both corresponding blank values in column J, and there are numeric values in column D. (D and J are in separate sheets.)

另一个公式是相同的事情,除了它只会确定B中的单元格的中位数,其中列J中的相应单元格不为空。

The other formula is the do the same thing, except it will only determine the median for the cells in B for which the corresponding cells in column J are not blank.

我应该注意我确定使用command-shift-enter输入它们,因为它们是数组公式。但是,对于他们来说,它都是零。我已经尝试了很长时间,不知道为什么。我是新的Excel公式,所以请让我知道,如果我应该澄清我的问题。

I should note I am making sure to enter them in with command-shift-enter, since they are array formulas. However, it's coming out to zero for both of them. I've tried for a long time and can't figure out why. I'm new to Excel formulas, so please let me know if I should clarify my question.

第一个公式:

=MEDIAN(IF(

 AND('Raw Data'!$J$3:'Raw Data'!$J$999="", ISNUMBER('Raw Data'!$D$3:'Raw Data'!$D$999)),

 B$6:B$1002))

第二个公式:

=MEDIAN(IF(

 AND(NOT(ISBLANK('Raw Data'!$J$3:'Raw Data'!$J$999)), ISNUMBER('Raw Data'!$D$3:'Raw Data'!$D$999)),

 B$6:B$1002))


推荐答案

相当于 AND 的数组是乘法 *

=MEDIAN(IF(('Raw Data'!$J$3:$J$999="")*
            ISNUMBER('Raw Data'!$D$3:$D$999),
            B$6:B$1002)
       )

与数组条目( CTRL + SHIFT + ENTER )。

with array entry (CTRL+SHIFT+ENTER).

公式:

=MEDIAN(IF(NOT(ISBLANK('Raw Data'!$J$3:$J$999))*
           ISNUMBER('Raw Data'!$D$3:$D$999),
           B$6:B$1002)
       )

还有数组输入。

解释为什么 AND not work。

Explanation why AND not working.

你所期待的是 AND({TRUE,FALSE,FALSE},{TRUE,TRUE, FALSE})返回 {TRUE,FALSE,FALSE}

但是, AND 采用布尔值的数组并返回 / em>布尔值 - 表示所有值是否为 TRUE FALSE

However, AND takes array of boolean values and returns single boolean value - which indicates whether all values are TRUE or FALSE.

所以, AND({TRUE,FALSE,FALSE},{TRUE,TRUE,FALSE})返回 FALSE 因为不是所有的值都是 TRUE

So, AND({TRUE,FALSE,FALSE},{TRUE,TRUE,FALSE}) returns FALSE because not all values are TRUE.

但是,乘法 {TRUE,FALSE,FALSE} * {TRUE,TRUE,FALSE} 完全按照需要运行 - 它返回 {TRUE * TRUE,FALSE * TRUE,FALSE * FALSE} = {TRUE,FALSE,FALSE}

But, multiplication {TRUE,FALSE,FALSE}*{TRUE,TRUE,FALSE} works exactly as you need it - it returns {TRUE*TRUE,FALSE*TRUE,FALSE*FALSE} = {TRUE, FALSE, FALSE}

这篇关于使用嵌套的IF和AND数组公式确定中值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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