+ Reply to Thread
Results 1 to 5 of 5

Using SEQUENCE Array Formulas - Varying Repeating Sequence

  1. #1
    Registered User
    Join Date
    01-18-2021
    Location
    california, united states
    MS-Off Ver
    MS365 (PC) Version 2209
    Posts
    39

    Using SEQUENCE Array Formulas - Varying Repeating Sequence

    Hey all,

    I'm trying to write an array formula using SEQUENCE. I'm new to using array formulas so I'm not sure if this can be done but maybe one of you smart folks knows of a way.

    Essentially, I have a repeating sequence. Every third repetition of the sequence should be slightly different:

    1 2 3 4 1 2 3 4 1 2 3 4 5 1 2 3 4 1 2 3 4 1 2 3 4 5 ...

    This entire series (1 2 3 4 1 2 3 4 1 2 3 4 5) should repeat 4 times, giving results across 52 cells.

    I am able to write a formula to repeat up to 4 quite easily:

    =MOD(SEQUENCE(,13*4)-1,4)+1

    I can also write a formula that alternates between 4 4 5, which I believe should have some role in the final formula (essentially replacing the hard-coded 4 in the formula above to dynamically determine whether the sequence should repeat from 1 to 4 or 1 to 5).

    =IF(MOD(MOD(SEQUENCE(,12)-1,12)+1,3)=0,5,4)

    Replacing the 4 in the first formula with the second formula obviously does not return the desired results. I know I need to consider the remainder after division somehow but am having trouble wrapping my mind around this one.

    I would greatly appreciate any help.

  2. #2
    Registered User
    Join Date
    01-18-2021
    Location
    california, united states
    MS-Off Ver
    MS365 (PC) Version 2209
    Posts
    39

    Re: Using SEQUENCE Array Formulas - Varying Repeating Sequence

    I did some digging and was able to modify an answer I found elsewhere (I would post the link but I am too new to do so; it is Eric W.'s response to "Alternating sequence of numbers" on Mrexcel.com) It's a little crude in that I need to manually list my sequence but it works! Any other possible solutions would be greatly appreciated as well.

    =INDEX({1,2,3,4,1,2,3,4,1,2,3,4,5},MOD(SEQUENCE(,13*4,0),13)+1)

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

    Re: Using SEQUENCE Array Formulas - Varying Repeating Sequence

    How about
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-18-2021
    Location
    california, united states
    MS-Off Ver
    MS365 (PC) Version 2209
    Posts
    39

    Re: Using SEQUENCE Array Formulas - Varying Repeating Sequence

    This works as well and is very elegant! I'll have to do some research on LET and FILTER to understand the logic better. Thank you very much for your response!

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

    Re: Using SEQUENCE Array Formulas - Varying Repeating Sequence

    Glad to help & thanks 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. [SOLVED] Repeating Sequence of Numbers
    By T.I. in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-05-2021, 08:07 AM
  2. Return the number sequence of repeating value
    By NAXIB in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-08-2019, 02:14 AM
  3. [SOLVED] How to generate auto sequence number for repeating sets of array
    By rajatp in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-27-2018, 05:20 AM
  4. Repeating sequence, how?
    By pepijnkr in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 01-30-2017, 08:53 AM
  5. [SOLVED] repeating sequence
    By abhijit2610 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-21-2016, 11:12 AM
  6. Repeating sequence
    By HakeemJones in forum Excel General
    Replies: 9
    Last Post: 11-13-2014, 12:51 PM
  7. Repeating a sequence
    By Slothook in forum Excel General
    Replies: 3
    Last Post: 10-28-2011, 04:05 PM

Tags for this Thread

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