Mastering Google Sheets TEXTJOIN: A Practical Guide

Master TEXTJOIN in Google Sheets to concatenate values with a delimiter, ignore blanks, and combine multiple ranges. Includes practical formulas, Apps Script tips, and best practices for students and professionals.

How To Sheets
How To Sheets Team
·5 min read
Quick AnswerDefinition

TEXTJOIN is a Google Sheets function that concatenates values from multiple cells or ranges into a single string using a chosen delimiter. It can ignore empty cells, handle mixed data types, and join across multiple ranges or arrays. This guide focuses on practical usage, common patterns, and troubleshooting to make data consolidation effortless in Google Sheets.

What TEXTJOIN does in Google Sheets

TEXTJOIN is a powerful Google Sheets function that composes a single text string from many cells or ranges by inserting a delimiter between each item. It is especially useful when you need to present compact lists, addresses, or combined fields without writing lengthy CONCAT or JOIN formulas. The key advantages are simplicity, flexibility with ranges and arrays, and the option to ignore empty cells. In practice, you might use it to assemble a full name from first, middle, and last name columns, or to create a comma-separated list from a column of values.

Excel Formula
=TEXTJOIN(" ", TRUE, A2:A6)

This joins non-empty cells in A2:A6 with a single space.

Excel Formula
=TEXTJOIN(", ", TRUE, A2:A6, B2:B6)

This demonstrates that you can pass multiple ranges.

Excel Formula
=TEXTJOIN(" - ", FALSE, A2:A6)

With ignore_empty set to FALSE you may see extra delimiters where blanks exist. A practical tip from How To Sheets: combine TEXTJOIN with array literals like {A2:A5; B2:B5} to join across multiple columns in a vertical stack.

TEXTJOIN syntax and parameters explained

The TEXTJOIN function has a simple signature but powerful breadth: TEXTJOIN(delimiter, ignore_empty, text1, [text2], ...). The delimiter is the string that separates joined items (e.g., a space, comma, or dash). ignore_empty decides whether empty cells should be omitted (TRUE) or included as separators (FALSE). You can pass individual cells, entire ranges, or a mix of both. This flexibility makes TEXTJOIN ideal for data cleanup, report generation, and dynamic lists.

Excel Formula
=TEXTJOIN(", ", TRUE, A2:A5)
Excel Formula
=TEXTJOIN(" ", FALSE, A2, B2, C2)
Excel Formula
=TEXTJOIN(" - ", TRUE, {A2:A5; B2:B5})

Another common pattern is filtering out blanks before joining:

Excel Formula
=TEXTJOIN(", ", TRUE, FILTER(A2:A10, A2:A10<>""))

This last example shows how TEXTJOIN pairs with FILTER to produce clean results from irregular data.

Basic usage: simple joins

A straightforward use case is to concatenate a column of items into a single, readable string. This is common for creating lists from data entries like names, tags, or categories. By specifying a delimiter and enabling ignore_empty, you can turn a multi-row column into a compact string with minimal setup. The delimiter choice affects readability—space for names, comma for lists, or pipe for structured identifiers.

Excel Formula
=TEXTJOIN(" ", TRUE, A2:A10)

If you need to combine two separate columns, you can pass multiple ranges:

Excel Formula
=TEXTJOIN(", ", TRUE, A2:A10, B2:B10)

These patterns work well in dashboards, summaries, and export-ready strings. Remember: TEXTJOIN makes what used to require nested CONCATs much simpler.

Ignoring blanks and combining ranges

One of TEXTJOIN’s strongest features is ignoring blanks, which prevents awkward gaps in the final string. Use ignore_empty = TRUE and rely on FILTER to trim out empty cells before joining. You can also join across non-contiguous ranges with array literals, such as {A2:A5; C2:C5}, to stitch together columns or rows without restructuring your sheet.

Excel Formula
=TEXTJOIN(", ", TRUE, FILTER(A2:A10, A2:A10<>""))
Excel Formula
=TEXTJOIN(" ", TRUE, {A2:A5; C2:C5})

If you have a handful of known non-empty cells, you can interpolate them directly as well:

Excel Formula
=TEXTJOIN("; ", TRUE, A2, A5, B3)

Pro tip: when data contains stray spaces, pair TEXTJOIN with TRIM to normalize values before joining.

Joining multiple ranges and array constants

TEXTJOIN shines when you need to merge data from several sources or hard-coded lists. You can use array constants to create inline lists, or vertically concatenate ranges. This is handy for combining static keys with dynamic data.

Excel Formula
=TEXTJOIN(" - ", TRUE, {"Alpha"; "Beta"; "Gamma"})
Excel Formula
=TEXTJOIN(" ", TRUE, {A2:A5; B2:B5})

For more complex layouts, you can mix ranges and arrays:

Excel Formula
=TEXTJOIN(", ", TRUE, A2:A5, {"X";"Y";"Z"})

Keep in mind that when you mix vertical ranges, you’ll get a single, flat result. This is ideal for creating identifiers or compact summaries that span multiple data sources.

Practical examples: names, addresses, and lists

TEXTJOIN is especially useful for building readable strings from structured data. For a contact sheet, you might join first name, middle initial, and last name into a full name column. For addresses, you can fuse multiple address lines into a single field suitable for exports. The key is selecting a delimiter that matches your downstream use case (spaces for names, commas for addresses).

Excel Formula
=TEXTJOIN(" ", TRUE, A2:A5, B2:B5, C2:C5)
Excel Formula
=TEXTJOIN(", ", TRUE, A2:A10)

If you work with IDs, you can prepend a marker or tag:

Excel Formula
=TEXTJOIN("|", TRUE, "ID-" & A2:A10)

TEXTJOIN keeps your data model tidy by reducing the number of helper columns needed for string assembly.

TEXTJOIN with FILTER, SPLIT, and dynamic data

Advanced workflows combine TEXTJOIN with FILTER and SPLIT to drive dynamic lists from criteria. For example, join all non-empty items in a filtered column, or concatenate a transformed set of values. You can also join a split result that reorganizes text on a delimiter before recombining it.

Excel Formula
=TEXTJOIN(", ", TRUE, FILTER(A2:A10, LEN(A2:A10) > 0))
Excel Formula
=TEXTJOIN(" ", TRUE, SPLIT(JOIN(" ", A2:A10), " "))

A more practical variant is to join only items that satisfy a condition, then display the result in a summary row or popup. This approach keeps your dashboards crisp and up to date.

Apps Script integration: using TEXTJOIN in Apps Script

If you automate Google Sheets with Apps Script, you can rely on TEXTJOIN directly in formulas or reproduce its behavior in JavaScript. A simple approach is to set a formula on a target cell, which leverages TEXTJOIN inside Sheets:

JavaScript
function joinUsingTextJoin() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); // Use TEXTJOIN directly in Sheets for simplicity sheet.getRange("B1").setFormula('=TEXTJOIN(" ", TRUE, A2:A10)'); }

Alternatively, you can compute the join in Apps Script and write the resulting string back:

JavaScript
function joinInScript() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var values = sheet.getRange("A2:A10").getValues(); var flat = values.flat().filter(function(v){ return v != null && v !== ""; }); var result = flat.join(" "); sheet.getRange("B1").setValue(result); }

Both approaches are valid; using the built-in TEXTJOIN keeps formulas readable, while Apps Script offers more complex data flows and error handling when building concatenated strings from multiple sources.

Common pitfalls and performance tips

TEXTJOIN is convenient, but certain patterns can trip you up. One common pitfall is forgetting to set ignore_empty to TRUE, which can leave unwanted delimiters when blanks exist. Always validate your data range to ensure there are no unexpected blanks unless you want separators between empty items. Another pitfall is relying on very large ranges; TEXTJOIN will pull all values into memory, which can impact performance in large sheets.

Excel Formula
=TEXTJOIN("; ", FALSE, A2:A1000) // beware trailing separators if blanks exist
Excel Formula
=TEXTJOIN(", ", TRUE, A2:A1000) // ignore blanks for clean results

Tip: combine TEXTJOIN with FILTER to limit inputs to non-empty or meeting certain criteria, reducing overhead and keeping dashboards snappy.

Final practical workflow: building a compact data string for export

A common workflow is to generate a compact, delimited string from a data table for import into other systems. First, clean the data with FILTER to remove blanks or unwanted values. Then join using TEXTJOIN with a delimiter suited to your target. This approach minimizes post-processing and ensures consistent formatting across exports.

Excel Formula
=TEXTJOIN(",", TRUE, FILTER(A2:A100, A2:A100 <> ""))
Excel Formula
=TEXTJOIN(" | ", TRUE, FILTER(A2:A100, LEN(A2:A100) > 0), B2:B100)

As you adopt TEXTJOIN in more scenarios, consider documenting common patterns in a small template so teammates can reuse them without reinventing the wheel. This aligns with best practices in data hygiene and reporting.

Quick-start recap and next steps

With TEXTJOIN, you can rapidly convert lists into readable strings, combining multiple ranges or arrays with a chosen delimiter. The real power comes from combining TEXTJOIN with FILTER, SPLIT, or Apps Script for automated workflows. Practice the patterns shown here on sample data, then adapt to real-world tasks like assembling customer lists, product SKUs, or location strings. Remember to test with missing values and ensure the final strings meet your downstream requirements.

Bonus: common variants to explore next

  • Joining with a vertical stack: {A1:A5; B1:B5} to create a single string from two columns
  • Using an empty string as a delimiter to merge without spaces while preserving separators
  • Pairing TEXTJOIN with REGEXREPLACE to sanitize content before joining
  • Combining TEXTJOIN with VLOOKUP-like lookups to assemble related fields dynamically
  • Export-ready formatting: wrap the result with TRIM and CLEAN to remove hidden characters and extra spaces

Steps

Estimated time: 40-60 minutes

  1. 1

    Define delimiter and ignore_empty

    Choose a delimiter that matches your target output (e.g., space, comma, dash). Decide whether empty cells should contribute a separator by setting ignore_empty to TRUE or FALSE. This groundwork prevents unwanted delimiters in the final string.

    Tip: Start with a simple dataset to validate delimiter behavior before scaling up.
  2. 2

    Write a basic TEXTJOIN formula

    Create a basic TEXTJOIN using a column of data and test the result. This confirms the core behavior of joining values with your chosen delimiter.

    Tip: Use a small range first to verify results before applying to larger ranges.
  3. 3

    Extend to multiple ranges

    Add another range to the TEXTJOIN call to combine data from different columns. This demonstrates the function’s flexibility with mixed inputs.

    Tip: When combining ranges of different lengths, rely on ignore_empty and avoid partial references that produce errors.
  4. 4

    Incorporate filters for clean output

    Wrap ranges with FILTER or LEN to exclude blanks or unwanted values from joining. This reduces noise in export-worthy strings.

    Tip: FILTER(..., LEN(...)) is a robust pattern for text joins on imperfect data.
  5. 5

    Validate results and handle edge cases

    Check for trailing delimiters, particularly when ignore_empty is FALSE. Consider using TRIM to clean extra spaces.

    Tip: Edge cases often pop up when data contains empty rows or special characters.
  6. 6

    Apply in real workbook and automate if needed

    Apply TEXTJOIN in a summary row or dashboard. If automation is needed, consider an Apps Script approach to set the formula dynamically or export results.

    Tip: Document the formula logic to help teammates reuse the pattern.
Pro Tip: Use TEXTJOIN with ignore_empty = TRUE to avoid extra punctuation from blank cells.
Note: TEXTJOIN can accept ranges and explicit values; combine with FILTER to limit inputs.
Warning: Be mindful of very large ranges; TEXTJOIN pulls values into memory and can impact performance.
Pro Tip: Pair TEXTJOIN with TRIM to clean stray spaces before joining.

Prerequisites

Optional

  • Sample dataset to practice TEXTJOIN (names, addresses, IDs, etc.)
    Optional
  • Apps Script editor access (optional for advanced examples)
    Optional

Keyboard Shortcuts

ActionShortcut
CopyCopy text or formula from a cell or editorCtrl+C
PastePaste into a cell or formula barCtrl+V
UndoRevert the last actionCtrl+Z
RedoReapply the last undone actionCtrl+Y
Fill downFill the formula or value down the columnCtrl+D
Fill rightFill the formula or value across the rowCtrl+R

FAQ

What is TEXTJOIN in Google Sheets?

TEXTJOIN concatenates text from multiple cells or ranges using a chosen delimiter. It can ignore empty cells and accept a mix of ranges and individual values, making it ideal for building compact strings for reports or exports.

TEXTJOIN brings together values from many cells into one string using a delimiter, and you can ignore blanks for clean results.

How do you ignore blanks when using TEXTJOIN?

Set the ignore_empty parameter to TRUE. This prevents extra delimiters caused by empty cells and yields a tidy result.

Set ignore_empty to true to skip empty cells when joining.

Can TEXTJOIN handle numbers?

Yes. TEXTJOIN converts numbers to text during concatenation. If you need specific numeric formatting, wrap the numbers with TEXT before joining.

Yes, numbers can be joined, but you might want to format them with TEXT first if you need particular formatting.

How do you join data from multiple sheets?

Refer to ranges from different sheets inside the TEXTJOIN call, e.g., =TEXTJOIN(" ", TRUE, Sheet1!A2:A10, Sheet2!A2:A10).

You can join ranges from multiple sheets by including them in TEXTJOIN.

What are common errors with TEXTJOIN?

Errors often come from mismatched ranges or mixing incompatible inputs. Ensure ranges align or use array literals to compose inputs.

Common issues include misaligned ranges; ensure inputs line up or use proper arrays.

How can TEXTJOIN be used with FILTER?

TEXTJOIN can join the results of FILTER to include only items that meet a condition, producing clean, dynamic lists.

Use FILTER inside TEXTJOIN to join only items that meet a condition.

The Essentials

  • Use TEXTJOIN to concatenate data quickly with a delimiter
  • Ignore blanks to keep output clean and readable
  • Combine multiple ranges or arrays in a single formula
  • Filter and split patterns extend TEXTJOIN capabilities
  • Apps Script can automate TEXTJOIN-based workflows

Related Articles