+ Reply to Thread
Results 1 to 16 of 16

Repeating Sequence of Numbers

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    273

    Repeating Sequence of Numbers

    Good day, how can I implement the repeating number sequence: 1,1,2,2,1,1,2,2,1,1... and etc.
    Searched through entire internet but could not find any solution.
    Thanks.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: Repeating Sequence of Numbers

    How about in B2 dragged down
    Formula: copy to clipboard
    =MOD(INT((ROWS(B$2:B2)-1)/2),2)+1

  3. #3
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,466

    Re: Repeating Sequence of Numbers

    I just saw Fluff's formula... use it (it is better than what I had posted).

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,466

    Re: Repeating Sequence of Numbers

    Here is another approach you can consider (but Fluff's formula is still probably better)...

    =0+MID("1122",1+MOD(ROWS($1:1)-1,4),1)

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,874

    Re: Repeating Sequence of Numbers

    Try

    =INT((MOD((ROWS($1:1)-1),4))/2)+1

    copy down
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  6. #6
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    273

    Re: Repeating Sequence of Numbers

    Fluff13, Brief, neat and great! Thank you.

    I composed some ugly formula as well:

    Formula: copy to clipboard
    =IF(AND((MOD(ROWS($A1:A1)-1,4)+1)>0,(MOD(ROWS($A1:A1)-1,4)+1)<3),1,2)


    JohnTopley, Rick Rothstein. Great as well! Thank you!
    Last edited by T.I.; 10-04-2021 at 03:33 PM.

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,787

    Re: Repeating Sequence of Numbers

    Glad to help & thanks for the feedback.

  8. #8
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,466

    Re: Repeating Sequence of Numbers

    If you want brief and neat, try it this way. Manually put a 1 in cells A1 and A2, then put this formula in cell A3 and copy it down...

    =3-A1
    Last edited by Rick Rothstein; 10-04-2021 at 04:12 PM.

  9. #9
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    273

    Re: Repeating Sequence of Numbers

    Quote Originally Posted by Rick Rothstein View Post
    If you want brief and neat, try it this way. Manually put a 1 in cells A1 and A2, then put this formula in cell A3 and copy it down...
    It would make sense if I just need a sequence itself. But I need this as a column parameter for INDEX to extract some data.

  10. #10
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,466

    Re: Repeating Sequence of Numbers

    I may be missing something, but in what way does what I proposed not work?

  11. #11
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    273

    Re: Repeating Sequence of Numbers

    It definitely work! But I needed solution in ONE formula without additional manual operations, like this:
    Manually put a 1 in cells A1 and A2
    Thanks.

  12. #12
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,466

    Re: Repeating Sequence of Numbers

    I guess I am missing the problem. To use the ONE formula, you would have to manually put it in a cell and then copy down. The only difference with my solution is before you manually put the formula in a cell, you simply have to manually enter 1 twice. Once you have done that, no further attention is needed. And the formula I proposed is more efficient as there are no function calls for Excel to have to evaluate. Anyway, you have a solution you are happy with and that is all that matters in the end.

  13. #13
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    273

    Re: Repeating Sequence of Numbers

    Attaching small example demonstrating the work of complete formula. Hope it will make things clear.
    Attached Files Attached Files

  14. #14
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    3,944

    Re: Repeating Sequence of Numbers

    ANS. post#13

    cell D2 formula , Drag down and across
    HTML Code: 

  15. #15
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    273

    Re: Repeating Sequence of Numbers

    Nice option via OFFSET, thank you!

  16. #16
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    3,944

    Re: Repeating Sequence of Numbers

    @Strogg You're Welcome. Glad to help . Thank You for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Return the number sequence of repeating value
    By NAXIB in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-08-2019, 02:14 AM
  2. Repeating sequence, how?
    By pepijnkr in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 01-30-2017, 08:53 AM
  3. [SOLVED] Show lowest missing number in a sequence w/repeating numbers and blanks
    By jayclinton in forum Excel General
    Replies: 6
    Last Post: 03-15-2016, 02:35 PM
  4. [SOLVED] repeating sequence
    By abhijit2610 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-21-2016, 11:12 AM
  5. Repeating sequence
    By HakeemJones in forum Excel General
    Replies: 9
    Last Post: 11-13-2014, 12:51 PM
  6. Repeating a sequence
    By Slothook in forum Excel General
    Replies: 3
    Last Post: 10-28-2011, 04:05 PM
  7. Repeating a sequence of numbers down a column
    By Nexan in forum Excel General
    Replies: 2
    Last Post: 03-04-2005, 02:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1