lundi 24 février 2020

Google Sheets Using Weekday in an Arrayformula

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

Aucun commentaire:

Enregistrer un commentaire