The text argument comes B5, and 1 is specified for the number of characters to extract. With the string “ABCD” in B5, the output from MID is an array that looks like this: This array is fed into the TEXTJOIN function as the text1 argument, with delimiter set to an empty string (""), and ignore blank set to TRUE (entered as 1): The TEXTJOIN function concatenates each element in the array together, ignoring blanks, and returns the final result, “DCBA”
Dynamic array
The array constant in the above example will only support string up to 10 characters. To use a dynamic array that scales to the right size, you can use a more complicated formula like this More information about generating an array of numbers here.
Dynamic array with SEQUENCE function
Excel 365 supports dynamic array formulas. In Excel 365, the SEQUENCE function can generate dynamic number arrays in one step. With SEQUENCE, the formula above can be simplified to: Inside SEQUENCE, the LEN function returns the count of characters in B5, 4. This result is used both for the rows argument and the start argument, with -1 provided for the step argument: and this array is delivered to the MID function as the start_num argument.
Dave Bruns
Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.