Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Is it possible to do a more concise IF x = 1 OR x = 2 OR x = 3 in Google Sheets?

$
0
0

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

    OR(        MOD(ROW(),7)=2,        MOD(ROW(),7)=3,        MOD(ROW(),7)=4,        MOD(ROW(),7)=5,        MOD(ROW(),7)=6    ),

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

    OR(        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.


Viewing all articles
Browse latest Browse all 9782

Trending Articles