Join column headers and texts in rows, when the cells are not empty

Rainbow_P

New Member
Joined
May 6, 2022
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Good day!


Raw data as in columns A, B, C.

A way is needed to join the column header and texts in rows, when the cells are not empty.

I am currently using TEXTJOIN("&",TRUE,"Name: "&A2,"Gender: "&B2,"Area: "&C2) in D2, but it includes the header when the cells are empty.

How can I achieve the results sampled in column E?

Thank you.

09_Nov.png
 

Attachments

  • 09_Nov.png
    09_Nov.png
    25.8 KB · Views: 4

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi
Try
Excel Formula:
=TEXTJOIN("&",TRUE,IF(A2<>"","Name:"&A2,""), IF(B2<>"","Gender:"&B2,""),IF(C2<>"","Area:"&C2,""))
Or
Excel Formula:
=TEXTJOIN("&",TRUE,IF(A2<>"",$A$1&":"&A2,""), IF(B2<>"",$B$1&":"&B2,""),IF(C2<>"",C1&":"&C2,""))
 
Last edited:
Upvote 0
Excel Formula:
=TEXTJOIN("&",TRUE,IF(A2<>"",$A$1&":"&A2,""), IF(B2<>"",$B$1&":"&B2,""),IF(C2<>"",$C$1&":"&C2,""))
 
Upvote 0
You are very welcome
And thank you for the feedback
Be happy and safe
 
Upvote 0

Forum statistics

Threads
1,214,636
Messages
6,120,664
Members
448,976
Latest member
sweeberry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top