≡ ▼
Work in Progress :: Please contact us to report errors, typos, etc.
=L_SE(start, end)
ArgumentDescriptionExample
startThe start value (integer or character) in the sequence2 or "B"
endThe end value (integer or character) in the sequence (can be < start)4 or "E"

Download the Template

In the template file, navigate to the Sequences worksheet to see the L_SE function in action.

Description

The L_SE function provides a shortcut for creating a sequence of integers or characters by just specifying the start value and end value. The end value can be less than the start value.

This can be accomplished with the SEQUENCE function as shown below, but the SE function shortcut is more concise.

L_SE(start,end) = SEQUENCE(ABS(end-start),1,start,SIGN(end-start))

L_SE(2,5) = {2;3;4;5}

When the start and end values are characters, the L_SE function uses the UNICODE and UNICHAR functions to first convert the characters to their UNICODE values. It then creates the sequence and converts it back to characters using UNICHAR.

L_SE("Z","X") = {"Z";"Y";"X"}

Lambda Formula

This code for using L_SE in Excel is provided under the License as part of the LAMBDA Library, but to use just this function, you may copy the following code directly into your spreadsheet.

Code to Create Function via the Name Manager

Name: L_SE
Comment: Create a sequence of integers or characters between start and end
Refers To:

=LAMBDA(start,end,
LET(doc,"https://www.vertex42.com/lambda/se.html",
    IF(ISNUMBER(start),
        SEQUENCE(ABS(end-start)+1,1,start,SIGN(end-start)),
        UNICHAR(SEQUENCE(ABS(UNICODE(end)-UNICODE(start))+1,1,UNICODE(start),SIGN(UNICODE(end)-UNICODE(start))))
    )
))

Code for AFE Workbook Module (Excel Labs Add-in)

/**
* Create a sequence of integers or characters between start and end
*/
L_SE = LAMBDA(start,end,
LET(doc,"https://www.vertex42.com/lambda/se.html",
    IF(ISNUMBER(start),
        SEQUENCE(ABS(end-start)+1,1,start,SIGN(end-start)),
        UNICHAR(SEQUENCE(ABS(UNICODE(end)-UNICODE(start))+1,1,UNICODE(start),SIGN(UNICODE(end)-UNICODE(start))))
    )
));

Named Function for Google Sheets

Name: L_SE
Description: Create a sequence of integers or characters between start and end
Arguments: start, end
Function:

=LET(doc,"https://www.vertex42.com/lambda/se.html",
  IF(ISNUMBER(start),
    SEQUENCE(ABS(end-start)+1,1,start,SIGN(end-start)),
    ARRAYFORMULA(UNICHAR(SEQUENCE(ABS(UNICODE(end)-UNICODE(start))+1,1,UNICODE(start),SIGN(UNICODE(end)-UNICODE(start)))))
  )
)
Warning
These functions are not compatible between Excel and Google Sheets. When using these functions, you will not be able to convert the Excel file to Google Sheets or vice versa without problems.

L_SE Examples

Example 1
Create an array of all the letters in the alphabet
=L_SE("a","z")

RESULT: {"a";"b";"c";"d";"e";"f";"g";"h";"i";"j";"k";"l";"m";"n";"o";"p";"q";"r";"s";"t";"u";"v";"w";"x";"y";"z"}

=L_SE("A","Z")

RESULT: {"A";"B";"C";"D";"E";"F";"G";"H";"I";"J";"K";"L";"M";"N";"O";"P";"Q";"R";"S";"T";"U";"V";"W";"X";"Y";"Z"}
Example 2
Create a sequence using the 6-sided dice unicode character
=L_SE("⚀","⚅")

RESULT: {"⚀";"⚁";"⚂";"⚃";"⚄";"⚅"}

See Also

SE, LINSPACE, LOGSPACE, RESCALE, MESHGRID

References & Resources
Disclaimer: This article is meant for educational purposes only. See the License regarding the LAMBDA code, and the site Terms of Use for the documentation.