Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING HTML & CSS BASH RUST TOOLS

Excel Tutorial

Excel HOME Excel Introduction Excel Get Started Excel Overview Excel Syntax Excel Ranges Excel Fill Excel Move Cells Excel Add Cells Excel Delete Cells Excel Undo Redo Excel Formulas Excel Relative Reference Excel Absolute Reference Excel Arithmetic Operators Excel Parentheses Excel Functions

Excel Formatting

Excel Formatting Excel Format Painter Excel Format Colors Excel Format Fonts Excel Format Borders Excel Format Numbers Excel Format Grids Excel Format Settings

Excel Data Analysis

Excel Sort Excel Filter Excel Tables Excel Conditional Format Excel Highlight Cell Rules Excel Top Bottom Rules Excel Data Bars Excel Color Scales Excel Icon Sets Excel Manage Rules (CF) Excel Charts

Excel PivotTables

Excel PivotTable Intro Excel Create PivotTable Excel PivotTable Values Excel PivotTable Filter Excel PivotTable Group Excel Calculated Field Excel PivotChart

Excel Case

Case: Poke Mart Case: Poke Mart, Styling

Excel Functions

AND AVERAGE AVERAGEIF AVERAGEIFS CONCAT COUNT COUNTA COUNTBLANK COUNTIF COUNTIFS DATEDIF FILTER HLOOKUP IF IFERROR IFS INDEX INDEX MATCH LEFT LEN LOWER MATCH MAX MEDIAN MID MIN MODE NETWORKDAYS NPV OR PROPER RAND RIGHT ROUND SORT STDEV.P STDEV.S SUBSTITUTE SUM SUMIF SUMIFS SUMPRODUCT TEXTJOIN TODAY TRIM UNIQUE UPPER VLOOKUP XLOOKUP XOR

Excel How To

Convert Time to Seconds Difference Between Times NPV (Net Present Value) Remove Duplicates

Excel Cert

Excel Certificate

Excel Examples

Excel Exercises Excel Syllabus Excel Study Plan Excel Training

Excel References

Excel Keyboard Shortcuts


Excel TEXTJOIN Function


Share

TEXTJOIN Function

The TEXTJOIN function is a premade function in Excel, which joins the text from several cells into one cell, with a delimiter between each value.

A delimiter is the text that separates the values, like a comma and a space. TEXTJOIN can also skip empty cells.

It is typed =TEXTJOIN and has the following parts:

=TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...)

Note: TEXTJOIN is available in Excel 2019 and later, Excel for Microsoft 365 and Excel for the web. It is not available in Excel 2016 or earlier versions.

Note: The different parts of the function are separated by a symbol, like comma , or semicolon ;

The symbol depends on your Language Settings.

Delimiter: The text to put between the values, inside double quotes. For example ", " for a comma and a space, or "/" for a slash.

Ignore_empty: TRUE skips empty cells. FALSE includes them, which can give two delimiters in a row.

Text1: The first text to join. This can be a cell, a range like A2:A11, or text inside double quotes.

Text2, ...: Optional. More text to join, separated by commas.

How to use the TEXTJOIN function:

  1. Select a cell (F2)
  2. Type =TEXTJOIN
  3. Double click the TEXTJOIN command
  4. Type the delimiter inside double quotes (", ")
  5. Type (,)
  6. Type TRUE to skip empty cells
  7. Type (,)
  8. Mark the range to join (A5:A7)
  9. Hit enter

Let's have a look at an example!

These are the first ten Pokemon from the table on the XLOOKUP page, with their types. Copy them and paste them into cell A1 to follow along:

Example data

ABC
1NameType 1Type 2
2BulbasaurGrassPoison
3IvysaurGrassPoison
4VenusaurGrassPoison
5CharmanderFire
6CharmeleonFire
7CharizardFireFlying
8SquirtleWater
9WartortleWater
10BlastoiseWater
11CaterpieBug

Type the label Fire Pokemon in E2.

Use the TEXTJOIN function to make a list of the Fire Pokemon in one cell. They are in A5:A7:

ABCDEF
1NameType 1Type 2
2BulbasaurGrassPoisonFire PokemonCharmander, Charmeleon, Charizard
3IvysaurGrassPoison
4VenusaurGrassPoison
5CharmanderFire
6CharmeleonFire
7CharizardFireFlying
8SquirtleWater
9WartortleWater
10BlastoiseWater
11CaterpieBug
=TEXTJOIN(", ", TRUE, A5:A7)

TEXTJOIN joins the names in A5:A7, and puts a comma and a space between them. There is no delimiter after the last name.



Skip Empty Cells

Some Pokemon have two types, and some have only one. Join Type 1 and Type 2 into one cell, with a slash between them.

Type the label Types in D1, and the formula in D2. Fill it down to D11:

ABCD
1NameType 1Type 2Types
2BulbasaurGrassPoisonGrass/Poison
3IvysaurGrassPoisonGrass/Poison
4VenusaurGrassPoisonGrass/Poison
5CharmanderFireFire
6CharmeleonFireFire
7CharizardFireFlyingFire/Flying
8SquirtleWaterWater
9WartortleWaterWater
10BlastoiseWaterWater
11CaterpieBugBug
=TEXTJOIN("/", TRUE, B2:C2)

Bulbasaur has two types, so the result is Grass/Poison.

Charmander has no Type 2. Because ignore_empty is TRUE, TEXTJOIN skips the empty cell C5, and the result is just Fire.

With FALSE, the empty cell is included, and the result ends with a slash:

ABCD
5CharmanderFireFire/
=TEXTJOIN("/", FALSE, B5:C5)

In most cases, you want TRUE.


Join the Pokemon of One Type

In the first example, you marked the Fire Pokemon yourself. With IF inside TEXTJOIN, Excel finds the Pokemon of a type for you, wherever they are in the list.

Type the labels Search Type in E4 and Pokemon in E5. Then type Water in F4, and the formula in F5:

EF
4Search TypeWater
5PokemonSquirtle, Wartortle, Blastoise
=TEXTJOIN(", ", TRUE, IF(B2:B11=F4, A2:A11, ""))

IF checks every row in B2:B11. When the type is the same as in F4, IF returns the name. Otherwise it returns an empty text "".

Because ignore_empty is TRUE, TEXTJOIN skips the empty texts, and joins only the names.

Try another type in F4, like Grass. The result changes to Bulbasaur, Ivysaur, Venusaur.

Note: This formula works as shown in Excel for Microsoft 365 and Excel 2021 or later, where Excel checks the whole range at once. In Excel 2019, press Ctrl+Shift+Enter instead of Enter to confirm the formula.

In Excel for Microsoft 365 and Excel 2021 or later, you can also use the FILTER function to get the same list:

=TEXTJOIN(", ", TRUE, FILTER(A2:A11, B2:B11=F4))

TEXTJOIN vs CONCAT

The CONCAT function also joins text, but it does not add a delimiter. =CONCAT(A5:A7) returns CharmanderCharmeleonCharizard.

CONCATTEXTJOIN
DelimiterNo, you type it between the values yourselfYes, typed once for all values
Leave out the delimiter for empty cellsNo, =CONCAT(B5, "/", C5) returns Fire/Yes, when ignore_empty is TRUE
Join a range, like A5:A7YesYes

If you need a delimiter between many values, TEXTJOIN is usually the easier choice.


Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.