1
votes

I have this formula which works fine when put into individual cells in a column:

 =OR(AND(AND(D2:D, WEEKDAY(NOW()) = 1),D2:D <>""),
    AND(AND(E2:E, WEEKDAY(NOW()) = 2),E2:E <>""),
    AND(AND(F2:F, WEEKDAY(NOW()) = 2),F2:F <>""),
    AND(AND(G2:G, WEEKDAY(NOW()) = 2),G2:G <>""),
    AND(AND(H2:H, WEEKDAY(NOW()) = 2),H2:H <>""),
    AND(AND(I2:I, WEEKDAY(NOW()) = 2),I2:I <>""),
    AND(AND(J2:J, WEEKDAY(NOW()) = 2),J2:J <>"")
   )

However I can't seem to get it to work in arrayformula:

 =ARRAYFORMULA(IF(LEN(A2:A),
  OR(AND(AND(D2:D, WEEKDAY(NOW()) = 1),D2:D <>""),
    AND(AND(E2:E, WEEKDAY(NOW()) = 2),E2:E <>""),
    AND(AND(F2:F, WEEKDAY(NOW()) = 2),F2:F <>""),
    AND(AND(G2:G, WEEKDAY(NOW()) = 2),G2:G <>""),
    AND(AND(H2:H, WEEKDAY(NOW()) = 2),H2:H <>""),
    AND(AND(I2:I, WEEKDAY(NOW()) = 2),I2:I <>""),
    AND(AND(J2:J, WEEKDAY(NOW()) = 2),J2:J <>"")
   ),""))

Here is the sheet shared so you can copy it: https://docs.google.com/spreadsheets/d/1TR-ayKtfOFC2LtQoIm8kzt7keTsyrqgxP0ZY9JVDcOs/edit?usp=sharing

[UPDATE:] My original formula had another error. PlayerO solved the AND OR issue but carried forward my error. Here is the corrected code that worked for my situation:

={"VaildDay";ARRAYFORMULA(IF(LEN(A2:A),
 ((((E2:E)*(WEEKDAY(NOW())=1))*(E2:E<>""))+
  (((F2:F)*(WEEKDAY(NOW())=2))*(F2:F<>""))+
  (((G2:G)*(WEEKDAY(NOW())=3))*(G2:G<>""))+
  (((H2:H)*(WEEKDAY(NOW())=4))*(H2:H<>""))+
  (((I2:I)*(WEEKDAY(NOW())=5))*(I2:I<>""))+
  (((J2:J)*(WEEKDAY(NOW())=6))*(J2:J<>""))+
  (((K2:K)*(WEEKDAY(NOW())=7))*(K2:K<>"")) = 1, ))
1

1 Answers

2
votes

change AND for * and OR for +:

=ARRAYFORMULA(IF(LEN(A2:A),
 ((((D2:D)*(WEEKDAY(NOW())=1))*(D2:D<>""))+
  (((E2:E)*(WEEKDAY(NOW())=2))*(E2:E<>""))+
  (((F2:F)*(WEEKDAY(NOW())=2))*(F2:F<>""))+
  (((G2:G)*(WEEKDAY(NOW())=2))*(G2:G<>""))+
  (((H2:H)*(WEEKDAY(NOW())=2))*(H2:H<>""))+
  (((I2:I)*(WEEKDAY(NOW())=2))*(I2:I<>""))+
  (((J2:J)*(WEEKDAY(NOW())=2))*(J2:J<>"")))=1, ))

0