Reputation: 13
I am trying to create a fairly basic sequence using a formula whereby columns follow the following order:
2,2,2,2,6,6,6,6,10,10,10,10,14,14,14,14 .....
I have tried a series of offsets and if statements but couldnt get it to function.
Upvotes: 1
Views: 909
Reputation: 175
Another way to do this is with the following code:
=IF(AND(A1=A2,A2=A3,A3=A4),A4+4,A4)
I got this idea from the following thread: Is there a way to find out the values of 4 cells are the same or different in MS Excel
Upvotes: 0
Reputation: 96791
For values in a column, in A1 enter:
=4*(ROUNDUP(ROW()/4,0))-2
and copy downward:
If you have Excel 365 and want to also make a comma-separated list, then pick another cell and enter:
=TEXTJOIN(",",TRUE,A:A)
If you have Excel 365 and want to make a comma-separated list without using a "helper column", then pick a cell and enter:
=TEXTJOIN(",",TRUE,4*(ROUNDUP(SEQUENCE(20)/4,0))-2)
Upvotes: 2