Formula needed to repeat pattern

ymurray

New Member
Joined
Apr 1, 2019
Messages
4
I have to populate various spreadsheets using the following number sequence:


1,1,1,1,1,1
2,2,2,2,2,2,2,2,2,2,2,2,2
3,3,3,3,3,3
4,4,4,4,4,4,4,4,4,4,4,4,4
etc..




So basically, I have to follow sequential numbers in the special pattern of 6 instances of 1, 13 instances of 2, 6 instances of 3, 13 instances of 4, etc. I have to go all the way down to 80 instances. Is there a formula I can use in order to not have to do this manually? I have about 4 different spreadsheets I need to do this for.
 
Glad we could help & thanks for the feedback
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I know I am late to this thread, but I thought the OP and future readers of this thread might find this one-liner solution to be of interest...
Code:
[table="width: 500"]
[tr]
	[td]Sub ymurray()
  Range("A1:A760") = Application.Transpose(Split(Join(Application.Transpose(Evaluate("IF({1},REPT(ROW(1:80)&"" "",13-7*mod(ROW(1:80),2)))")), "")))
End Sub[/td]
[/tr]
[/table]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top