ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Dynamic arrays
  3. List All Matching Values in One Cell

List All Matching Values in One Cell

By ExcelReady Team·Updated November 2, 2026·7 min read

The short answer

To list all matching values in one cell in Excel, wrap FILTER in TEXTJOIN: =TEXTJOIN(", ",TRUE,FILTER(A2:A8,B2:B8="Sales")). FILTER finds every row that matches, and TEXTJOIN joins the results with a comma and a space. This needs Excel 2021 or Microsoft 365. In Excel 2019, use IF inside TEXTJOIN instead.

Key takeaways

  • =TEXTJOIN(", ",TRUE,FILTER(values,condition)) puts every match in one cell, separated by commas.
  • Multiply conditions for AND and add them for OR inside FILTER.
  • Give FILTER a third argument, such as "None", so a criterion with no matches doesn't return #CALC!.
  • Add UNIQUE and SORT to remove repeats and put the list in order.
On this page+
  1. The sample data
  2. How to list matching values in one cell with TEXTJOIN and FILTER
  3. How to use a cell as the criteria
  4. How to list matches with two or more conditions
  5. How to remove duplicates and sort the list
  6. How to handle no matches and other display options
  7. How to list matches in one cell in older Excel
  8. When to use one cell and when to spill a list
  9. Practise it

To list matching values in one cell in Excel, use FILTER to find every match and TEXTJOIN to join them into a single text string: =TEXTJOIN(", ",TRUE,FILTER(A2:A8,B2:B8="Sales")). Instead of one result, like VLOOKUP gives, you get "Aisha, Carla, Elena" in one tidy cell. This guide is for anyone building a summary table, a report or a test answer where every match must fit in one place.

The sample data#

All the examples use this staff list in A1:C8:

ABC
1NameDepartmentOffice
2AishaSalesLondon
3BenITLeeds
4CarlaSalesLeeds
5DavidHRLondon
6ElenaSalesLondon
7FaridITLondon
8GraceHRLeeds

The question is: who works in Sales? A lookup like VLOOKUP or XLOOKUP stops at the first match and returns only "Aisha". You need all three names.

How to list matching values in one cell with TEXTJOIN and FILTER#

The formula has two parts. FILTER finds the matches, and TEXTJOIN joins them.

Excel formula
=TEXTJOIN(", ",TRUE,FILTER(A2:A8,B2:B8="Sales"))

The result is Aisha, Carla, Elena. Here is what each part does:

  • FILTER(A2:A8, B2:B8="Sales") checks each department and returns the names in rows where it is Sales. On its own, it would spill three names into three cells.
  • TEXTJOIN(", ", TRUE, ...) takes that list and joins it into one text string. The first argument is the delimiter, the text placed between items. TRUE tells it to skip empty cells.

Both functions need Excel 2021 or Microsoft 365. The FILTER function guide and the TEXTJOIN function guide explain every argument.

How to use a cell as the criteria#

Point the condition at a cell so one formula answers many questions. Type the departments Sales, IT and HR in E2:E4, then in F2:

Excel formula
=TEXTJOIN(", ",TRUE,FILTER($A$2:$A$8,$B$2:$B$8=E2))

Fill it down to F4 (Ctrl+D on Windows, ⌘D on a Mac):

DepartmentPeople
SalesAisha, Carla, Elena
ITBen, Farid
HRDavid, Grace

The $ signs lock the data ranges. E2 has no $, so it changes to E3 and E4 as you fill. This is the most useful form of the formula, because the summary table updates when the staff list changes.

How to list matches with two or more conditions#

Inside FILTER, multiply conditions for AND logic and add them for OR logic. Each condition goes in its own brackets.

AND: people in Sales who work in London:

Excel formula
=TEXTJOIN(", ",TRUE,FILTER(A2:A8,(B2:B8="Sales")*(C2:C8="London")))

The result is Aisha, Elena. Carla is in Sales but works in Leeds, so she is left out.

OR: people in Sales or HR:

Excel formula
=TEXTJOIN(", ",TRUE,FILTER(A2:A8,(B2:B8="Sales")+(B2:B8="HR")))

The result is Aisha, Carla, David, Elena, Grace, in the order they appear in the list. Each condition gives TRUE or FALSE for every row. Multiplying keeps a row only when both are TRUE, and adding keeps it when at least one is.

How to remove duplicates and sort the list#

Wrap FILTER in UNIQUE to drop repeats and in SORT to put the results in order. Which offices does the Sales team work in?

Excel formula
=TEXTJOIN(", ",TRUE,SORT(UNIQUE(FILTER(C2:C8,B2:B8="Sales"))))

FILTER returns London, Leeds, London. UNIQUE keeps London and Leeds, and SORT puts them in A to Z order. The result is Leeds, London. Without UNIQUE you would see London twice. To count the distinct items instead of listing them, see how to count unique values.

How to handle no matches and other display options#

If nothing matches, FILTER returns the #CALC! error, and TEXTJOIN passes it on. Give FILTER a third argument, the value to show when it finds nothing:

Excel formula
=TEXTJOIN(", ",TRUE,FILTER(A2:A8,B2:B8="Finance","None"))

The result is None, because no one works in Finance.

You can also change the delimiter to suit the report:

DelimiterResult for Sales
", "Aisha, Carla, Elena
" / "Aisha / Carla / Elena
CHAR(10)each name on its own line

CHAR(10) is a line break. Turn on Wrap Text on the Home tab, or the names run together on one line. If you want text before the list, such as "Team: ", join it with &, as shown in adding text to cells.

A cell can hold up to 32,767 characters. If the joined text would be longer, TEXTJOIN returns #VALUE!. That is rarely a problem for names, but it can happen with long comments.

How to list matches in one cell in older Excel#

In Excel 2019, which has TEXTJOIN but not FILTER, use IF to build the list:

Excel formula
=TEXTJOIN(", ",TRUE,IF(B2:B8="Sales",A2:A8,""))

IF returns the name for Sales rows and an empty string for the others. TEXTJOIN then skips the empty strings because the second argument is TRUE. In Excel 2019, confirm the formula with Ctrl+Shift+Enter so it works as an array formula. In Microsoft 365, plain Enter is enough.

Excel 2016 and earlier don't have TEXTJOIN. There, a PivotTable that lists names under each department is often the simplest option.

When to use one cell and when to spill a list#

One cell is best for summaries, labels and short lists you read at a glance. A spilled list is better when you want to sort, count or use the results in other formulas, because each match sits in its own cell.

Keep in mind that the joined result is text. You can't sum it, and a lookup can't find one name inside it without a wildcard. If the staff list grows, turn it into an Excel table (Ctrl+T on Windows, ⌘T on a Mac) and point the formula at the table columns, so new rows are included without editing the ranges. The guide on returning multiple values with a lookup covers the spilled version, and making a top N list shows how to pick only the highest values.

Practise it#

Practise the FILTER function in a live spreadsheet: you type the formula and it checks it instantly. Then practise joining text to get comfortable with TEXTJOIN, and try the exercise on this page, which lists the Sales team in one cell.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

In E2, list every name in the Sales department in one cell, separated by a comma and a space. Use TEXTJOIN and FILTER.

fx
ABCDEF
1
Name
Department
Office
Sales team
2
Aisha
Sales
London
3
Ben
IT
Leeds
4
Carla
Sales
Leeds
5
David
HR
London
6
Elena
Sales
London
7
Farid
IT
London
8
Grace
HR
Leeds
9
10
11

Tip: FILTER(A2:A8,B2:B8="Sales") finds the names. Put it inside TEXTJOIN with ", " as the delimiter and TRUE to skip blanks.

Practise this in a lesson

LessonFILTER: pull matching rows with a formulaReturn every row that meets one or more conditions with FILTER, and show a friendly message when nothing matches.LessonJoining text: &, CONCAT and TEXTJOINBuild full names, addresses and tag lists by joining text with &, CONCAT and TEXTJOIN.Function guideTEXTJOINJoin cells with commas, spaces or semicolons using TEXTJOIN, and skip blanks automatically. Examples, pitfalls and a live exercise.Function guideFILTERReturn every row that matches a condition with Excel's FILTER. Multiple criteria, empty results and #SPILL! explained, with live practice.

Frequently asked questions

How do I return multiple values in one cell in Excel?

+

Use =TEXTJOIN(", ",TRUE,FILTER(A2:A8,B2:B8=E2)). FILTER returns every matching value and TEXTJOIN joins them into one text string.

How do I list matching values in one cell without FILTER?

+

In Excel 2019, use =TEXTJOIN(", ",TRUE,IF(B2:B8=E2,A2:A8,"")) and confirm it with Ctrl+Shift+Enter. Excel 2016 and earlier have no TEXTJOIN, so you need a helper column or a PivotTable.

How do I put each match on a new line in the same cell?

+

Use CHAR(10) as the delimiter, as in =TEXTJOIN(CHAR(10),TRUE,FILTER(A2:A8,B2:B8=E2)), then turn on Wrap Text for the cell.

Why does my TEXTJOIN FILTER formula show #CALC!?

+

FILTER found no matching rows. Add a third argument to FILTER, such as "None", and the cell shows that text instead.

Is there a limit to how much TEXTJOIN can join?

+

Yes. A cell can hold up to 32,767 characters. If the joined text is longer, TEXTJOIN returns #VALUE!.

Sources

  • TEXTJOIN function - Microsoft Support
  • FILTER function - Microsoft Support
  • UNIQUE function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. The sample data
  2. How to list matching values in one cell with TEXTJOIN and FILTER
  3. How to use a cell as the criteria
  4. How to list matches with two or more conditions
  5. How to remove duplicates and sort the list
  6. How to handle no matches and other display options
  7. How to list matches in one cell in older Excel
  8. When to use one cell and when to spill a list
  9. Practise it

Keep reading

Lookups· 6 min read

Return Every Match for a Lookup in Excel (FILTER)

VLOOKUP and XLOOKUP stop at the first match. To return every match, use FILTER: =FILTER(B2:B7,A2:A7=F2) lists all the orders for the customer in F2, spilling one per row. Add a third argument such as "No orders" for when nothing matches, and wrap it in TEXTJOIN to put all matches in one cell. FILTER needs Excel 2021 or Microsoft 365.

Text· 6 min read

REPT in Excel: Simple In-Cell Bar Charts

REPT repeats text a number of times: =REPT("|",5) returns |||||. To draw an in-cell bar chart, repeat a character in proportion to each value, such as =REPT("|",B2/1000) for one bar per 1,000. Scale long bars with =REPT("|",ROUND(B2/MAX($B$2:$B$7)*20,0)) so the largest value gets 20 characters.

Dynamic arrays· 6 min read

Make a Top 5 List With SORT and FILTER

To make a top 5 list with a formula, keep the rows whose value is at least the 5th largest, then sort them: =SORT(FILTER(A2:C9,C2:C9>=LARGE(C2:C9,5)),3,-1). Change 5 to 10 for a top 10 list. It spills the whole rows, largest first, and includes ties. It needs Excel 2021, Excel 2024 or Microsoft 365.

More on dynamic arrays

  • How to Randomize a List in Excel With SORTBY
  • How to Reverse the Order of a List in Excel
  • The SEQUENCE Function in Excel
  • Make a List of Dates With SEQUENCE in Excel
  • Sort and Filter Together With One Formula
  • Sort by Multiple Columns in Excel (Formula and Menu)
All dynamic arrays articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free