Created
July 17, 2023 17:00
-
-
Save 1504168/00546b5c399ecaffa76ebe92ac273ba7 to your computer and use it in GitHub Desktop.
Like excel SEQUENCE Function but for generating character.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This will generate character sequence based on param. | |
//Example case =CHARSEQUENCE(2, 2,"AA",2) will give an output like this ={"AA","AC";"AE","AG"} | |
CHARSEQUENCE =LAMBDA(NumberOfRow, NumberOfColumn, [StartChar], [Step], | |
LET( | |
_StartCol, IF(ISOMITTED(StartChar), 1, COLUMN(INDIRECT(StartChar & 1))), | |
_StepCorrected, IF(ISOMITTED(Step), 1, Step), | |
_Array, SEQUENCE(NumberOfRow, NumberOfColumn, _StartCol, _StepCorrected), | |
_Result, MAP( | |
_Array, | |
LAMBDA(Curr, | |
LET( | |
Address, ADDRESS(1, Curr, 4), | |
RemoveRow, MID(Address, 1, LEN(Address) - 1), | |
RemoveRow | |
) | |
) | |
), | |
_Result | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment