Forum Discussion

Nishkarsh31's avatar
Nishkarsh31
Brass Contributor
Apr 09, 2021
Solved

How to generate a sequence with 3 consecutives 1's and 3 consecutives 0's based on a table?

I've already got a formula, it's almost efficient Needs minor correction. I've attached a sample file. It's self explanatory. PeterBartholomew1 SergeiBaklan 
  • PeterBartholomew1's avatar
    Apr 09, 2021

    Nishkarsh31 

    I would recommend sticking with integers for this type of calculation in order to avoid rounding error problems altogether.  In particular, the integer divide function QUOTIENT can be valuable when you want to group values.

    = LET(
      k, SEQUENCE(1,COLUMNS(Recipe),2),
      MOD(QUOTIENT(k,3),2) )

    Normally 'k' should be a zero-based index but here you want a two cell offset with only one opening zero.

Resources