Variable Sequences

test3xc31

New Member
Joined
Jun 11, 2019
Messages
27
Office Version
  1. 2021
Platform
  1. Windows
I am trying to make a formula where I can generate the following variable sequence depending on the value in A1.

If A1 = 2 the formula would cycle between A1,A2,B1,B2,A1,A2,B1,B2, and so on, but if the A1 = 5 it would cycle between A1,A2,A3,A4,A5,B1,B2,B3,B4,B5,C1,C2,C3,C4,C5,D1,D2,D3,D4,D5,E1,E2,E3,E4,E5,A1,A2,A3,A4,A5, before returning to A and repeating

Any pointers would be appreceated!

ABCDEFGHIJKLMNOPQRSTU
2A1A2B1B2A1A2B1B2A1A2B1B2A1A2B1B2A1A2B1B2
3A1A2A3B1B2B3C1C2C3A1A2A3B1B2B1C1C2C3A1A2
4A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4A1A2A3A4
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also will the output always be 20 columns?
 
Upvote 0
Very good point and done, thankyou for the suggestion! I would prefer an option that didn't have a limit on the output however right now if it can only work for 20 columns I'll take it! I've been trying to work this one out for nearly week now!
 
Upvote 0
Thanks for that.
How about
++Fluff.xlsm
ABCDEFGHIJKLMNOPQRSTU
1
22AABBAABBAABBAABBAABB
33AAABBBCCCAAABBBCCCAA
44AAAABBBBCCCCDDDDAAAA
Data
Cell Formulas
RangeFormula
B2:U4B2=CHAR(MOD(INT(SEQUENCE(,20,0)/A2),A2)+65)
Dynamic array formulas.


To adjust the number of columns just change the 20 inside the sequence function
 
Upvote 0
Just realised that you have changed your original request, so how about
++Fluff.xlsm
ABCDEFGHIJKLMNOPQRSTU
1
22A1A2B1B2A1A2B1B2A1A2B1B2A1A2B1B2A1A2B1B2
33A1A2A3B1B2B3C1C2C3A1A2A3B1B2B3C1C2C3A1A2
44A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4A1A2A3A4
Data
Cell Formulas
RangeFormula
B2:U4B2=CHAR(MOD(INT(SEQUENCE(,20,0)/A2),A2)+65)&MOD(SEQUENCE(,20,0),A2)+1
Dynamic array formulas.
 
Upvote 0
Solution
Just realised that you have changed your original request, so how about
++Fluff.xlsm
ABCDEFGHIJKLMNOPQRSTU
1
22A1A2B1B2A1A2B1B2A1A2B1B2A1A2B1B2A1A2B1B2
33A1A2A3B1B2B3C1C2C3A1A2A3B1B2B3C1C2C3A1A2
44A1A2A3A4B1B2B3B4C1C2C3C4D1D2D3D4A1A2A3A4
Data
Cell Formulas
RangeFormula
B2:U4B2=CHAR(MOD(INT(SEQUENCE(,20,0)/A2),A2)+65)&MOD(SEQUENCE(,20,0),A2)+1
Dynamic array formulas.
Honestly I cannot thank you enough! though I'm going to have to spend the next week trying to work out how on earth that works!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,025
Messages
6,122,734
Members
449,094
Latest member
dsharae57

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