# Excel Question ... sorry about this.

**URL:** <https://boards.straightdope.com/t/excel-question-sorry-about-this/418124>\
**Category:** Factual Questions\
**Created:** [September 5, 2007, 2:45pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124 "2007-09-05T14:45:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Inigo\_Montoya](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/inigo_montoya/32/124_2.png) [@Inigo\_Montoya](https://boards.straightdope.com/u/Inigo_Montoya)\
**Post date:** [September 5, 2007, 2:45pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/1 "2007-09-05T14:45:39Z")

</div>

I’m usually pretty good about getting Excel to dance to whatever tune I want to play, but this time I’m stumped and it’s a really simple problem.

How do you concatenate a [carriage return] into a string?

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [September 5, 2007, 2:50pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/2 "2007-09-05T14:50:02Z")

</div>

\<Alt\>\<Enter\>

---

<div class="post-metadata">

**Author:** ![sandra\_nz](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@sandra\_nz](https://boards.straightdope.com/u/sandra_nz)\
**Post date:** [September 5, 2007, 3:32pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/3 "2007-09-05T15:32:30Z")

</div>

I think the OP is wanting to preserve carriage returns in cells when CONCATENATE-ing but is finding they dissapear. Is that correct, OP?

---

<div class="post-metadata">

**Author:** ![Inigo\_Montoya](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/inigo_montoya/32/124_2.png) [@Inigo\_Montoya](https://boards.straightdope.com/u/Inigo_Montoya)\
**Post date:** [September 5, 2007, 4:03pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/4 "2007-09-05T16:03:05Z")

</div>

Interesting result there, Mr. Omnivore, and that may yet come in handy. But what I’m looking for is a character that can be concatenated between two strings that will induce a carriage return when the result is pasted into notepad/word document, etc.

The code would look something like: =concatenate(A23,?,B23,?,C23) and result in:

A23  
B23  
C23

---

<div class="post-metadata">

**Author:** ![sandra\_nz](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@sandra\_nz](https://boards.straightdope.com/u/sandra_nz)\
**Post date:** [September 5, 2007, 4:09pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/5 "2007-09-05T16:09:39Z")

</div>

I have a feeling it’s something like CHAR13?

---

<div class="post-metadata">

**Author:** ![SCSimmons](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@SCSimmons](https://boards.straightdope.com/u/SCSimmons)\
**Post date:** [September 5, 2007, 4:20pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/6 "2007-09-05T16:20:52Z")

</div>

[QUOTE=sandra\_nz]  
I have a feeling it’s something like CHAR13?  
[/QUOTE]

Very close, **sandra**. It’s CHAR(10).

---

<div class="post-metadata">

**Author:** ![Inigo\_Montoya](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/inigo_montoya/32/124_2.png) [@Inigo\_Montoya](https://boards.straightdope.com/u/Inigo_Montoya)\
**Post date:** [September 5, 2007, 4:47pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/7 "2007-09-05T16:47:21Z")

</div>

=char(10) and =char(13) both work fine when I paste the result into Word. Neither work when I paste into Notepad or into the program I need to paste it into. Figures.

What I’m pasting into is a (I think) VB-based questionnaire which then loads the text into a (I think) COBOL-based display program.

---

<div class="post-metadata">

**Author:** ![Mbossa](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mbossa](https://boards.straightdope.com/u/Mbossa)\
**Post date:** [September 5, 2007, 8:51pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/8 "2007-09-05T20:51:03Z")

</div>

CHAR(13) is a carriage return and CHAR(10) is a line feed. The correct one to use depends on your operating system. In Windows, you use a carriage return AND a line feed together (Linux uses CR by itself and MacOS uses LF by itself).

So try something like

```auto

=concatenate(A23,CHAR(13),CHAR(10),B23,CHAR(13),CHAR(10),C23)

```

It’s likely that Word automatically detects and converts newlines from other operating systems, but Notepad and your program obviously don’t.

---

<div class="post-metadata">

**Author:** ![Inigo\_Montoya](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/inigo_montoya/32/124_2.png) [@Inigo\_Montoya](https://boards.straightdope.com/u/Inigo_Montoya)\
**Post date:** [September 5, 2007, 9:00pm UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/9 "2007-09-05T21:00:29Z")

</div>

_ **Plants a big sloppy kiss on Mbossa’s teeth** _

That did the trick!

---

<div class="post-metadata">

**Author:** ![Mangetout](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mangetout/32/19_2.png) [@Mangetout](https://boards.straightdope.com/u/Mangetout)\
**Post date:** [September 6, 2007, 12:43am UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/10 "2007-09-06T00:43:35Z")

</div>

[QUOTE=Inigo Montoya]  
Interesting result there, Mr. Omnivore, and that may yet come in handy. But what I’m looking for is a character that can be concatenated between two strings that will induce a carriage return when the result is pasted into notepad/word document, etc.  
[/quote]  
Ah… I didn’t realise that when you said _concatenate_, you really meant it.

> [@](#):
>
> What I’m pasting into is a (I think) VB-based questionnaire which then loads the text into a (I think) COBOL-based display program.

Oh, you have one of those jobs too, I see.

---

<div class="post-metadata">

**Author:** ![Inigo\_Montoya](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/inigo_montoya/32/124_2.png) [@Inigo\_Montoya](https://boards.straightdope.com/u/Inigo_Montoya)\
**Post date:** [September 6, 2007, 1:30am UTC](https://boards.straightdope.com/t/excel-question-sorry-about-this/418124/11 "2007-09-06T01:30:34Z")

</div>

[QUOTE=Mangetout]  
Ah… I didn’t realise that when you said _concatenate_, you really meant it.

Oh, you have one of those jobs too, I see.  
[/QUOTE]

Heh…largest personal lines insurance claims operation in North America. Software cobbled together since the mid-70s and massaged elevnty-one different ways to keep pace with the legal environments for 50 states and chunks of Canada. We have software that nobody knows the origins of doing things that nobody understands for departments nobody’s really sure exist anymore. There have been suggestions that we scrap the old 'warez and develop a totally modern & compatable-without-translator-programs environment that would allow underwriting, service, claims and agency to operate together seamlessly. But nobody ever listens to me.
