How to Join Cells in Excel and Skip Blanks with TEXTJOIN

Open an Excel workbook (.xlsx) in Cue Office and use TEXTJOIN to combine city, street, unit, and contact into a single shipping label. Use a vertical bar with a space on each side as the delimiter and set the second argument to TRUE so empty fields do not leave extra separators.

How do I join shipping fields with a custom delimiter?

Create a new spreadsheet in Cue Office, select A1, and paste the practice data. Columns A through D contain City, Street, Unit, and Contact. Cell C2 for Boston is empty, and Seattle is missing both a unit number and a contact.

Cell A1 selected in a blank spreadsheet in Cue Office
Paste starting at A1. City, Street, Unit, and Contact run across columns A through D.

Select F2 and paste these three lines of formulas. In the first formula, " | " sets the separator to a vertical bar with a space on each side. TRUE skips empty cells, and A2:D2 reads the four fields from left to right. The next two formulas use the same columns on rows 3 and 4.

=TEXTJOIN(" | ",TRUE,A2:D2)
=TEXTJOIN(" | ",TRUE,A3:D3)
=TEXTJOIN(" | ",TRUE,A4:D4)

F2 displays Boston | 12 Oak St | Nora, with the contact appearing directly after the street. Austin has all four fields, so F3 includes Unit 4. Seattle is missing two fields, so F4 displays Seattle | 5 Lake Ave.

Why are there extra separators when a field is blank?

Select J2 and paste the three formula lines below. Changing the second argument to FALSE keeps a place for empty cells, letting you compare the result side-by-side with column F in the same row.

=TEXTJOIN(" | ",FALSE,A2:D2)
=TEXTJOIN(" | ",FALSE,A3:D3)
=TEXTJOIN(" | ",FALSE,A4:D4)

In Boston’s J2 label, the empty unit number leaves a gap between the street and contact in Boston | 12 Oak St | | Nora. Seattle’s J4 label ends in two vertical bars. Austin has all four fields, so F3 and J3 match. Save and reopen the workbook, then check all three rows.

Formula bar for J2 showing FALSE as the second argument. Column F skips blanks, column J keeps blanks, and all three results are visible
Compare columns F and J in the same row. Boston shows an empty segment in column J, and Seattle ends with two extra delimiters.

If extra delimiters appear in your labels, check the second argument first. Use TRUE to skip missing values, and make sure the missing cells are truly blank.

How can Cue AI generate labels that update?

In a copy of the sheet containing the three shipping records with F2:F4 left blank, open Cue AI from Home.

Cue AI pane open on the left, with three shipping records and blank cells F2:F4 on the right
Before opening Cue AI, make sure F2:F4 contains no previous labels.
Can you make a shipping label for each row in F2:F4 from the city, street, unit, and contact in columns A through D, in that order? Use TEXTJOIN, with " | " between the parts that have a value. Skip any blank field, including the first or last field, so there are no extra separators. Make the labels update when I change the source fields, and leave everything outside F2:F4 as it is.

In this example, Cue AI added formulas only in F2:F4. Save and reopen the copy. Check that Nora follows the street in Boston’s label and that Seattle’s label ends at the street address.

After reopening the AI workbook, the formula in F2 is visible along with the three labels for Boston, Austin, and Seattle
After reopening, select F2 and verify that the formula bar references A2:D2.

Next, enter Apt 2 into C2 for Boston. F2 updates to Boston | 12 Oak St | Apt 2 | Nora. The labels for Austin and Seattle remain unchanged.

After entering Apt 2 in C2, Apt 2 appears in the Boston label, while Austin and Seattle labels remain unchanged
After adding the unit number, Apt 2 appears between the street and contact.

Practice with three shipping records

Show the full example

Paste the following data into A1. F1 and J1 serve as headers for the two result columns. Return to formula steps.

City	Street	Unit	Contact		Skip blanks				Keep blanks
Boston	12 Oak St		Nora
Austin	8 Pine Rd	Unit 4	Ivy
Seattle	5 Lake Ave

Check the next batch before shipping

Before dispatching, spot-check one complete address label and one label missing a unit or contact. If column order changes in your next shipping sheet, provide Cue AI with the new field positions, the desired sequence on the label, and the target output column. Once updated address details arrive, confirm that unit numbers appear correctly between street and contact.

If a buyer sends a PDF address confirmation (.pdf), open it for free in Cue Office and check the street and unit number against your Excel shipping sheet (.xlsx). In a Word handover log (.docx), list the orders that still need a callback and which fields are missing. If you report shipping progress at a shift meeting, show the number of checked and pending orders separately in a PowerPoint deck (.pptx). Cue Office offers free spreadsheet, document, and presentation editing.

Download Cue Office for free