Manually concatenating filtered spreadsheet data remains a tedious bottleneck for financial analysts. When tracking standard capital allocations or federal funding sources, bridging disparate rows into a single, cohesive report is historically cumbersome. Fortunately, leveraging dynamic formulas grants immediate analytical clarity by automating this synthesis.
As a brief stipulation, this advanced method requires modern Excel engines (Office 365 or 2021) to support dynamic arrays. Organizations successfully utilize this to aggregate compliance data, such as merging multiple EPA grant codes into a single, semicolon-delimited cell.
Below, we will examine the precise step-by-step formula combining TEXTJOIN and FILTER to streamline your reporting workflow.
Excel is an incredibly powerful tool for data analysis, but one of its most common challenges is working with data that has been filtered. When you apply a filter to a dataset, the hidden rows are still technically there-they are just tucked out of sight. This becomes a significant roadblock when you try to concatenate or combine those visible rows into a single cell separated by a semicolon.
If you use the standard CONCAT or TEXTJOIN functions on a filtered range, Excel will frustratingly include all the hidden rows in your final output. In this comprehensive guide, we will explore several robust formulas and techniques to combine only the filtered, visible rows in Excel with a semicolon, ranging from modern dynamic array formulas to backward-compatible helper columns and VBA solutions.
Imagine you have a list of email addresses, project IDs, or task names in column A. You filter the table to show only "High Priority" items. You now want to copy all the visible emails or IDs into a single cell, separated by a semicolon (;), so you can easily copy-paste them into an email client or another system. Here is how to achieve exactly that.
If you are using Microsoft 365 or Excel 2021, you have access to dynamic arrays and Lambda helper functions. We can combine TEXTJOIN, FILTER, BYROW, and SUBTOTAL to create a single-cell formula that updates dynamically as you change your manual filters.
=TEXTJOIN("; ", TRUE, FILTER(A2:A20, BYROW(A2:A20, LAMBDA(row, SUBTOTAL(103, row)))))
SUBTOTAL(103, row): The function number 103 corresponds to COUNTA while ignoring hidden rows. If a row is visible, SUBTOTAL returns 1. If it is filtered out (hidden), it returns 0.BYROW(A2:A20, LAMBDA(...)): Normally, SUBTOTAL cannot evaluate an array row-by-row on its own. The BYROW function forces Excel to look at each individual row in our range and apply the SUBTOTAL check, generating an array of 1s (visible) and 0s (hidden).FILTER(A2:A20, ...): This filters our original range, keeping only the cells where the BYROW array returned 1 (visible).TEXTJOIN("; ", TRUE, ...): Finally, this joins the filtered array of text strings, using a semicolon and a space ("; ") as the delimiter, and ignores any empty cells (TRUE).If you do not have Microsoft 365 (meaning you lack the BYROW and LAMBDA functions) but still have Excel 2019, you can easily solve this problem using a single helper column. This is often the most stable and easiest-to-understand method for legacy versions.
In an empty column next to your data (let's say Column B, starting at B2), enter the following formula and drag it down to match your data rows:
=SUBTOTAL(103, A2)
This formula will output a 1 if the row is visible and a 0 if the row is hidden by a filter.
Now, in the cell where you want your concatenated, semicolon-separated list, write the following formula:
=TEXTJOIN("; ", TRUE, IF(B2:B20=1, A2:A20, ""))
Note: If you are using Excel 2019, you may need to press Ctrl + Shift + Enter to enter this as an array formula.
Alternative using FILTER: If you have Excel 2021, you can write a cleaner version without the array entry:
=TEXTJOIN("; ", TRUE, FILTER(A2:A20, B2:B20=1))
Sometimes, we filter a list manually just to extract specific data. If you are doing this, you can bypass the manual filter UI altogether. You can write a formula that dynamically filters the data based on your criteria and joins them instantly. This prevents you from needing to manually click filter buttons.
Suppose Column A contains the values you want to combine (Emails), and Column B contains the status ("Active", "Inactive"). You only want to combine emails where the status is "Active".
=TEXTJOIN("; ", TRUE, FILTER(A2:A20, B2:B20="Active"))
This is highly recommended because it is completely automated. If you change a status in Column B, your combined semicolon list updates instantly without you needing to re-apply manual filters.
If you are working with older Excel versions (like Excel 2016 or 2013) that do not have the TEXTJOIN or FILTER functions, or if you want an incredibly simple formula syntax, a quick VBA macro is the best approach.
Press ALT + F11 to open the VBA editor, click Insert >
Module, and paste the following code:
Function JoinVisible(WorkRange As Range,;
String);
String
Dim Cell;
Range
Dim Result;
String
For Each Cell In WorkRange
' Check if the row and column of the cell are not hidden
If Cell.EntireRow.Hidden = False And Cell.EntireColumn.Hidden = False Then
If Cell.Value <> "" Then
Result = Result & Cell.Value & Delimiter
End If
End If
Next Cell
' Remove the trailing delimiter
If Len(Result) > 0 Then
Result = Left(Result, Len(Result) - Len(Delimiter))
End If
JoinVisible = Result
End Function
Close the VBA window and return to your Excel sheet. Now, you can use this brand-new custom function just like any native Excel formula:
=JoinVisible(A2:A20, "; ")
This custom function automatically loops through your range, completely ignores any cells hidden by filters or manual row hiding, skips blanks, and concatenates them with your specified delimiter.
If you are dealing with very large datasets (thousands of rows) and need to output combined, filtered strings regularly, Power Query is the cleanest, non-formula way to handle this.
List.Sum([ColumnName]). Change List.Sum to:
Text.Combine([ColumnName], "; ")
| Excel Version | Preferred Method | Pros | Cons |
|---|---|---|---|
| Excel 365 / 2024 | Method 1 (BYROW + TEXTJOIN) | No helper columns, fully dynamic. | Slightly complex formula syntax. |
| Excel 2019 / 2021 | Method 2 (Helper Column + TEXTJOIN) | Easy to audit, highly reliable. | Requires adding an extra column. |
| Excel 2016 & Older | Method 4 (VBA User-Defined Function) | Clean formula syntax, works on all versions. | Requires saving workbook as Macro-Enabled (.xlsm). |
| Any (Large Data) | Method 5 (Power Query) | Extremely fast, great for repeatable reports. | Does not update "instantly" (requires a refresh click). |
By using these tailored strategies, you can easily control how Excel processes your hidden data, allowing you to quickly format and export clean, semicolon-separated lists from any filtered view.
Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.