How can I generate numbers in patterns such as 1,2,1,2,3,4,3,4,5,6,5,6,7,8,7,8... in Excel?
Thank you for your help in advance!
How can I generate numbers in patterns such as 1,2,1,2,3,4,3,4,5,6,5,6,7,8,7,8... in Excel?
Thank you for your help in advance!
What is the "rule" for the pattern? If I follow correctly, the rule is:
0) Start with seed value.
1) Add 1
2) subtract 1
3) add 1
4) add 1
5) Go to step 1
Here's how I would implement the above algorithm in a spreadsheet.
1) Enter my seed value in my desired starting cell. I chose A3. In A2 I enter "seed" to remind me what is supposed to go in A3.
2) In row 2, I will enter the desired value to add at each step.
2a) In B2, I enter 1.
2b) In C2, I enter -1.
2c) In D2, i enter 1
2d) In E2, I enter 1.
2e) From here, I am just repeating the values, so I enter =B2 into F2, and copy/paste/fill across as far as I want the series to exist.
3) Calculate the series in row 3. In B3, I enter =A3+B2. Copy/paste/fill across as far as I want.
Does something like that work for you? What works and what doesn't work?
Originally Posted by shg
The first 4 values set a pattern. In the diagram below, A1:A4 are entered manually. In A5, enter this formula:and drag down as far as required.Formula:![]()
Please Login or Register to view this content.
Row\Col A 1 1 2 2 3 1 4 2 5 3 6 4 7 3 8 4 9 5 10 6 11 5 12 6 13 7 14 8 15 7 16 8 17 9 18 10 19 9 20 10
Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee
Hi zzxxclc and welcome to the forum,
How about a formula in the first cell and pull it down? Try this formula.
Formula:![]()
Please Login or Register to view this content.
in the attached:
Two Step Counts.xlsm
One test is worth a thousand opinions.
Click the * Add Reputation below to say thanks.
It worked! Thank you so much for your help![]()
I believe your approach is easier but I'm not allowed to enter values manually for the first 4 rows. I really appreciate your help though!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks