简体   繁体   English

在Excel数组IF公式输出中排除空白/假单元格

[英]Exclude blank/FALSE cells in in Excel array IF formula output

I am having difficulties with making an array formula work the way I want it to work. 我在使数组公式按我希望的方式工作时遇到困难。

Out of a column of dates which is not sorted, I want it to extract values into a new column. 在未排序的日期列中,我希望它将值提取到新列中。 The formula below identifies the required cells of a given month and year, but they appear in their original row rather than on top of the output range. 下面的公式标识了给定月份和年份的必需单元格,但是它们出现在其原始行中,而不是在输出范围的顶部。 Moreover, I want all ""/FALSE cells to be excluded from the output array. 此外,我希望所有“” / FALSE单元格从输出数组中排除。

=IF((MONTH($I$15:$I$1346)=1)*(YEAR($I$15:$I$1346)=2008),$I$15:$I$1346,"")

In fact, the $I$15:$I$1346 should be dynamic and go to the last filled range (I could make a named range for that) 实际上,$ I $ 15:$ I $ 1346应该是动态的,并转到最后填充的范围(我可以为此指定一个范围)

Part two is to expand on that formula so that it calculates the data that is an two column offset of the data described above. 第二部分是对该公式进行扩展,以便它计算出上述数据的两列偏移量的数据。

Is the above possible to build into one cell probably with a combination of IF, INDEX, SMALL and maybe others? 是否可以将IF,INDEX,SMALL以及其他结合使用,从而将上述内容构建到一个单元中?

I'm not looking for a filter solution. 我不是在寻找过滤器解决方案。 Hope the above is clear enough and that you can help! 希望以上内容足够清楚,希望对您有所帮助!

Here's a shortened sample layout: 这是缩短的示例布局:

    A           B          C
1   Date        Series_A   Series_B
2   03/01/2011  45         20
3   04/01/2011  73         30
4   06/01/2011  95         40
5   08/01/2011  72         50
6   06/02/2011  5          13
7   09/02/2011  12         #N/A
8   05/02/2011  23         65
9   07/03/2011  12         65

Then I want three input cells for the year and and the month and series name (index/match, as there are many more columns with data). 然后,我需要三个输入单元格,分别用于年份,月份和系列名称(索引/匹配,因为有更多的数据列)。 If it would be 2011, Feb and Series_A, I want it to calculate the average for that month. 如果是2011年,2月和Series_A,我希望它计算该月的平均值。 In this case it would be (5+12+23)/3. 在这种情况下,它将是(5 + 12 + 23)/ 3。 If it would be Feb-2011 and Series_B instead, which has an error, it should show (13+65)/2 rather than an error. 如果是2011年2月,而Series_B却有错误,则应该显示(13 + 65)/ 2,而不是错误。

Aside from that I want a separate which will output an array with the data instead without 'holes' in between and with the right 'length'. 除此之外,我还希望有一个单独的模块,该模块将输出带有数据的数组,而不是在它们之间以及正确的“长度”之间没有“空洞”。 Example for Feb-2011 in Column C: C列中的2011年2月示例:

    A           B          C                  D
1   Date        Series_A   Desired Output     Output based on f above
2   03/01/2011  45         5                  
3   04/01/2011  73         12
4   06/01/2011  95         23
5   08/01/2011  72         
6   06/02/2011  5                             5
7   09/02/2011  12                            12
8   05/02/2011  23                            23
9   07/03/2011  12  

If I then run a =ISBLANK(C5) it should be true, rather than =""=C5 如果然后运行= ISBLANK(C5),则应为true,而不是=“” = C5

Hope the edit clarifies 希望编辑澄清

I reached out to various platsforms to get an answer, and here you have one which is ok. 我接触了各种平台以获得答案,在这里您可以确定。 Still doesn't fully answer part 1, but works nonetheless. 仍然不能完全回答第1部分,但是仍然可以工作。

http://www.excelforum.com/excel-formulas-and-functions/905356-exclude-blank-false-cells-in-in-excel-array-if-formula-output.html http://www.excelforum.com/excel-formulas-and-functions/905356-exclude-blank-false-cells-in-in-excel-array-if-formula-output.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM