Using INDIRECT in Array Formula

人盡茶涼 提交于 2020-05-17 08:44:27

问题


I use this arrayformula along with INDIRECT because it is the only way I know to maintain my references since the reference sheet has in the script to routinely add another row to sheet Data!. How can I either add to the below formula to only show values in the array that are above the value in $CQ$17 and below the value in $CQ$16? Can this be done without increasing my sheets processing time since it updates every minute?

=ARRAYFORMULA(INDIRECT("Data!E"&13+$F$7&":E"&597+$F$7))

回答1:


IIUC, you do not need no INDIRECT and could use either QUERY:

=QUERY(
  OFFSET(Data!E13, $F$7, 0, 597 - 13 + 1, 1),
  "
    select E
    where E > " & $CQ$17 & " and
          E < " & $CQ$16,
  -1
)

or FILTER:

=FILTER(
  OFFSET(Data!E13, $F$7, 0, 597 - 13 + 1),
  OFFSET(Data!E13, $F$7, 0, 597 - 13 + 1) > $CQ$17,
  OFFSET(Data!E13, $F$7, 0, 597 - 13 + 1) < $CQ$16
)

Those three times constructing the same range are not good, I would go with QUERY.

A sample sheet would be really helpful though.



来源:https://stackoverflow.com/questions/61489475/using-indirect-in-array-formula

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!