The following is a part of a formula I'm using to filter for week day rows (for conditional formatting):


What I really want to be able to say is something like the below pseudo-code:

        MOD(ROW(),7) IN (2,3,4,5,6)

Is there a way of doing that? I prefer the non-repating, more concise, and (I think) more performant nature of the proposed version.

Performance isn't something I expected to have to think about but this is a snippet of a pretty long formula I'm running on every cell in a spreadsheet and it gets quite slow.

  • 1
    What about MOD(ROW(),7)>1?
    – JohnSUN
    May 17 at 12:14
  • That is perfect. Why didn't I think of that?! Doesn't quite answer my general question, but perfectly suits my real-world use case. Thank you! Can you write that as an answer so I can accept?
    – Matt
    May 17 at 13:05

2 Answers 2


Since the result of MOD(ROW(),7) can have 2 inappropriate values (0 and 1) and 5 suitable values (2..6), it makes sense to check the condition for a shorter sequence:


In this case, there is no need to connect multiple conditions using OR()


To answer your general question.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.