Formula for accumulating text data in a cell with carriage return

Sinisha

New Member
Joined
Apr 29, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi!

I hope someone can shed some light on the following problem:

- I have only 4 cells in the same row (A,B,C,D)
- Cells A, B, C contain predictable text data. Cell A is either empty or contains text "plank", cell B is either empty or contains text "squats", cell C is either empty or contains text "stretch"
- In one row all 4 cells may be filled out, none or just some
- What I would like to have in the cell D is a summary of the A,B,C cells in a way that text from these cells is copied to cell D one below the other
- Example: Let's say that cells A,B,C are all filled out. What I would need in cell D, in that case, is the text:
plank
squats
stretch

The carriage return is a must because I'm using this sheet later on for importing data into DB and this is the format DB will recognize.

Usually, I can handle excel formulas but this one is simply beyond me.

Help is much appreciated!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Try this:

=TEXTJOIN(CHAR(10),TRUE,A1:C1)

or if you dont have the function textjoin you could try:

=SUBSTITUTE(TRIM(A1&" "&B1&" "&C1)," ",CHAR(10))
 
Upvote 0
Make sure the Wrap Text Function is used in the cell to enable Line Breaks
 
Upvote 0
Spot on! TEXTJOIN does the job perfectly and Wrap Text tip was a great pointer.

Thanks so much to both of you!
 
Upvote 0

Forum statistics

Threads
1,214,847
Messages
6,121,911
Members
449,054
Latest member
luca142

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