Combine Excel Cells with a Greater-Than Separator and Skip Blanks
Question details
Combine values from cells D through G into one cell, separated by greater-than signs, while ignoring blank cells.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Create a single text string from the nonblank values in a row.
- Observed behavior
- The desired result contains a greater-than sign between each included value, with no separators for blank cells.
Identify the row containing your values and choose an empty cell outside columns D through G for the result. The examples below use row 1; change the row number to match your data.
Use TEXTJOIN to combine nonblank cells
Use this formula to add a greater-than separator only between values that are not empty.
Click an empty cell such as H1, outside the D1:G1 source range.
In H1, enter =TEXTJOIN(" > ",TRUE,D1:G1) and press Enter. TRUE tells Excel to ignore empty cells.
Drag the fill handle from the bottom-right corner of H1 down to copy the formula to other rows.

Trim spaces before joining the cells
Use this option when source values contain extra spaces that should be removed before combining.
Join Nonblank Cells with WPS Spreadsheet
Use TEXTJOIN in WPS Spreadsheet to combine values with a greater-than separator while skipping empty cells.
- 1. Open your spreadsheet: Open WPS Spreadsheet and select your workbook from Open.
- 2. Choose an output cell: Click an empty cell outside the source range, such as H1.
- 3. Join the values: Enter =TEXTJOIN(" > ",TRUE,D1:G1) and press Enter.
- 4. Copy the formula: Drag the fill handle down from H1 to apply the formula to additional rows.

Frequently Asked Questions
What does TRUE do in the TEXTJOIN formula?
In =TEXTJOIN(" > ",TRUE,D1:G1), TRUE tells Excel to ignore empty cells, so they do not create extra separators.
Can I use a different separator?
Yes. Replace " > " in the formula with another quoted delimiter. For example, use =TEXTJOIN(" / ",TRUE,D1:G1) for a slash surrounded by spaces.
Why does a cell containing spaces still appear in the result?
A cell containing spaces is not empty. Use =TEXTJOIN(" > ",TRUE,TRIM(D1:G1)) to remove ordinary extra spaces before joining.
Why does Excel show a #NAME? error for TEXTJOIN?
Your Excel version may not support TEXTJOIN, or the function name may be misspelled. Check the formula and use a version of Excel that supports TEXTJOIN.




