简体   繁体   English

Excel复杂数组

[英]Excel complicated array

I have a very long formula that churns out the correct answer when it is just focussed on calculating one row.我有一个很长的公式,当它只专注于计算一行时,它会产生正确的答案。

I want to turn this into an array that will sum over multiple rows, however as soon as i turn the formula into an array it then gives an incorrect value... and i don't know why!我想把它变成一个对多行求和的数组,但是一旦我把公式变成一个数组,它就会给出一个不正确的值......我不知道为什么! For some reason it seems to do an extra multiplication when i put it into an array, i believe anyway.出于某种原因,当我将它放入数组时,它似乎做了一个额外的乘法,我相信无论如何。

Original working formula on single row: =(IFERROR(.........单行原始工作公式:=(IFERROR(.........

+12.5*$C15), ....) +12.5*$C15), ....)

Not working array: {=SUM(IFERROR(.........不工作数组:{=SUM(IFERROR(.........

+12.5*$C15:$C16), ....) +12.5*$C15:$C16), ....)

When C15 is 0.5, the array returns a value that is 6.25 too low When C15 is 1, the array returns a value that is 12.5 too low When C15 is 1, the array returns a value that is 25 too low当 C15 为 0.5 时,数组返回的值太低 6.25 当 C15 为 1 时,数组返回的值太低 当 C15 为 1 时,数组返回的值太低 25

So it is most definitely something to do with the 12.5 but i don't understand why turning it into an array makes it return a value too low.所以它绝对与 12.5 有关,但我不明白为什么将它转换为数组会使它返回的值太低。

Based on the duplicate question found here: https://stackoverflow.com/questions/42025870/excel-array-formula-complicated?noredirect=1基于此处发现的重复问题: https : //stackoverflow.com/questions/42025870/excel-array-formula-complicated?noredirect=1

You do not need the IFERROR:您不需要 IFERROR:

The CSE array formula: CSE数组公式:

 =SUM(IF(ISNUMBER(SEARCH("S",B2:B3,1), 1, 2))

Remove the quotes around the numbers, with quotes they are strings and SUM will ignore them.删除数字周围的引号,引号是字符串,SUM 将忽略它们。

The ISNUMBER takes the place of the IFERROR. ISNUMBER 代替 IFERROR。

This is an array formula and needs to be confirmed with Ctrl + Shift + Enter .这是一个数组公式,需要用Ctrl + Shift + Enter 确认
If done correctly then Excel will put {} around the formula.如果操作正确,Excel 将在公式周围放置{}

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

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