Search code examples
excelsymbolsbit

How to rearrange a single row into multiple columns in Excel


I have one array of zeros and ones in one row like this:

https://i.sstatic.net/vb7Oz.png

But I want to rearrange them to look like this, every 5 bits in one row:

https://i.sstatic.net/uliOd.png


Solution

  • with Office 365:

    =INDEX($1:$1,SEQUENCE(INT(COUNT($1:$1)/5),5))
    

    The result will spill.

    enter image description here

    with older versions use:

    =INDEX($1:$1,((ROW($ZZ1)-1)*5)+COLUMN(A$1))
    

    Copy over five columns and down till you get all 0

    enter image description here