带有IFS函数的Arrayformula没有将输出结果展开到列中

问题描述 投票:0回答:1

我使用这个公式使用函数(arrayfomula)分配一个月中每周的数字。但该函数并未扩展整行的结果。有什么建议

https://docs.google.com/spreadsheets/d/1JOg8IWgs07OihXpmQbVVUl37T7b6R6xreKTicWfFk6E/edit?usp=sharing

公式在E5中

=   arrayformula(IFS(
  OR(
     (DAY(C5:C35) >= 1) * (DAY(C5:C35) <= 7),
     (DAY(C5:C35) >= 15) * (DAY(C5:C35) <= 21),
     (DAY(C5:C35) >= 29) * (DAY(C5:C35) <= 31)
  ), 1,
  OR(
     (DAY(C5:C35) >= 8) * (DAY(C5:C35) <= 14),
     (DAY(C5:C35) >= 22) * (DAY(C5:C35) <= 28)
  ), 2,
  TRUE, "" ))
google-sheets-formula array-formulas
1个回答
0
投票

您可以尝试:

=   arrayformula(IFS(
         (DAY(C5:C35) >= 1) * (DAY(C5:C35) <= 7)+
         (DAY(C5:C35) >= 15) * (DAY(C5:C35) <= 21)+
         (DAY(C5:C35) >= 29) * (DAY(C5:C35) <= 31)
      , 1,
         (DAY(C5:C35) >= 8) * (DAY(C5:C35) <= 14)+
         (DAY(C5:C35) >= 22) * (DAY(C5:C35) <= 28)
      , 2,
      TRUE, "" ))

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.