SE
=SE(start, end)
Argument | Description | Example |
---|---|---|
start | The start value (integer or character) in the sequence | 2 or "B" |
end | The end value (integer or character) in the sequence (can be < start) | 4 or "E" |
In the template file, navigate to the Sequences worksheet to see the SE function in action.
Description
The 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.
SE(start,end) = SEQUENCE(ABS(end-start),1,start,SIGN(end-start)) SE(2,5) = {2;3;4;5}
When the start and end values are characters, the 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.
SE("Z","X") = {"Z";"Y";"X"}
Lambda Formula
This code for using 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: 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 */ 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: 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))))) ) )
SE Examples
=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"} =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"}
=SE("⚀","⚅")
RESULT: {"⚀";"⚁";"⚂";"⚃";"⚄";"⚅"}
See Also
SE, LINSPACE, LOGSPACE, RESCALE, MESHGRID