One of the characteristics that makes modern Excel so powerful is also one of the things that occasionally catches users by surprise: dynamic array functions have a tendency to give you exactly what you ask for.
If you ask TEXTSPLIT to split a string containing twenty comma-separated values, it will quite happily return twenty separate columns. If tomorrow the source data contains thirty values instead, your formula will return thirty columns instead. The spill range simply grows to accommodate the data. Most of the time, this is precisely the behaviour we want. There are situations, however, where unlimited expansion becomes a problem rather than a benefit. Imported data often contains "free text" at the end of a record. CSV exports sometimes append notes, comments, or descriptions whose contents are unpredictable. Reports may contain a fixed number of important fields followed by miscellaneous information that we would prefer to keep together.
In these cases, the challenge is no longer splitting the text. The challenge is knowing when to stop.
Fortunately, modern Excel provides several elegant ways of controlling exactly how much of the spill range we keep.
Consider the following record:
If we use:
Excel produces seven separate columns. That is technically correct, but perhaps not especially useful.
Suppose our report only has room for four columns:
| First Name | Surname | City | Remaining Information |
|---|
The first three fields should occupy their own columns, while everything after the third comma should remain together.
Unfortunately, TEXTSPLIT has no parameter that says, "Only split the first three delimiters." At first glance, this appears to be a limitation. In reality, it simply requires a different way of thinking.
The key observation is that only part of the record is truly structured. The first name, surname, and city always occupy fixed positions. Everything after that represents miscellaneous information whose internal structure is no longer important for this particular report.
Rather than trying to persuade TEXTSPLIT to stop splitting, we can simply treat these two parts of the string differently. The first three fields can be extracted individually, while everything remaining is retrieved as one block.
For example:
The result is exactly four columns:
| First | Last | City | Remaining |
|---|---|---|---|
| John | Doe | Dublin | Ireland, Finance Department, Building 4, Desk 217 |
Notice what has happened. Instead of forcing TEXTSPLIT to behave differently, we have simply combined several smaller transformations into one logical result.
Many users instinctively search for a function that limits the number of columns produced. While such a parameter might be convenient, the approach above is arguably more expressive as it reflects the actual structure of the data. The first three fields represent individual attributes, and everything afterwards represents additional information whose internal structure is irrelevant to the report. The formula mirrors the business requirement rather than the mechanics of string parsing.
As with many modern Excel techniques, the goal is not merely to make the formula shorter, but to make its intent clearer.
There are situations, however, where we genuinely do want to discard the remaining columns altogether. Suppose an imported dataset contains twenty fields, but our analysis only requires the first four. In that case, TAKE provides a remarkably elegant solution.
Here, TEXTSPLIT performs the complete parsing, while TAKE simply retains the first four columns. Everything else is ignored.
This approach works particularly well when the additional fields have no value to the analysis. It is important to recognise, however, that those discarded values are genuinely lost from the result. If they still need to be preserved somewhere, the previous technique is usually more appropriate.
Sometimes the fields we need are not adjacent. Perhaps an imported record contains ten columns, but only the first, third, fifth, and eighth are relevant. Rather than constructing elaborate extraction formulas, CHOOSECOLS allows us to select exactly the columns we want.
The resulting formula reads almost like a sentence: split the text, keep columns one, three, five, and eight, ignore everything else. Again, the emphasis is on describing the desired outcome rather than the mechanics required to achieve it.
One misconception surrounding dynamic arrays is that spill behaviour is something to be accepted rather than managed. In reality, Microsoft has introduced an entire family of functions specifically for shaping spilled results. TAKE, DROP, CHOOSECOLS, CHOOSEROWS, WRAPROWS, WRAPCOLS, HSTACK, and VSTACK all exist for the same underlying reason: dynamic arrays produce collections of data and these companion functions allow us to reshape those collections into the form our workbook requires. Once viewed this way, spill ranges become remarkably flexible. They are not simply outputs; they are intermediate datasets that can themselves be transformed.
Although this article has focused on TEXTSPLIT, the principles extend much further. The same techniques can be applied to the results of FILTER, UNIQUE, SORT, MAP, and virtually every other dynamic array function. Rather than accepting the shape of the returned array, we can deliberately modify it to suit the needs of the workbook. This is an important shift in mindset as the output of one formula increasingly becomes the input to another. Instead of isolated calculations, we begin constructing pipelines of transformations, each producing a progressively more refined dataset.
One of the recurring themes throughout this entire series has been composition. The most effective formulas are rarely those that rely on a single extraordinary function. More often, they emerge from combining several relatively simple functions, each performing one clearly defined task.
TEXTSPLIT divides the data.
TEXTAFTER retrieves the remainder.
HSTACK assembles the final structure.
TAKE trims unnecessary columns.
CHOOSECOLS selects precisely the fields we require.
None of these functions is especially complicated on its own. Together, however, they allow us to solve problems that would once have required helper columns, manual imports, or custom VBA code. That, perhaps more than anything else, captures the philosophy of modern Excel. It is no longer about discovering one magical function that solves every problem. It is about learning how individual functions can be composed into elegant, readable, and maintainable solutions that describe the data exactly as we wish to see it.
Cat On A Spreadsheet