JenniferMurphy
Well-known Member
- Joined
- Jul 23, 2011
- Messages
- 2,676
- Office Version
- 365
- Platform
- Windows
Now I need to know how to get Excel to accept a linefeed character in a text expression.
In this table, E7:E11 have a texst string that is generated from the two cells to the left. The result is a single line.
If I create a chart using this data, I get:
But I would like the x-axis labels to look like the data in E13:E17. To get it, I copied the values above and then manually inserted a linefeed (Alt+Enter). I cannot figure out how to get that linefeed into the expression so that E7:E11 look like E13:E17. That gives me this chart, which is what I want.
Is there a way to enter code for a linefeed in that expression? I do it in VBA using vbCrLf, but if I put that in the expression, I get a #NAME error.
Thanks
In this table, E7:E11 have a texst string that is generated from the two cells to the left. The result is a single line.
Book1 (version 1).xlsb | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | |||
5 | Dates | Average mg/dL | ||||||||
6 | Start | End | Days | X Axis | AM | PM | Insulin | Victoza | ||
7 | 6/10/20 | 8/31/20 | 82 | 8/31/20 (82) | 153 | 216 | 56 | |||
8 | 8/11/20 | 10/27/20 | 77 | 10/27/20 (77) | 153 | 207 | 45 | 1.12 | ||
9 | 10/12/20 | 2/02/21 | 113 | 2/02/21 (113) | 163 | 207 | 45 | 1.72 | ||
10 | 1/20/21 | 2/20/21 | 31 | 2/20/21 (31) | 159 | 213 | 45 | 1.80 | ||
11 | 2/20/21 | 3/07/21 | 15 | 3/07/21 (15) | 159 | 228 | 46 | 1.80 | ||
12 | ||||||||||
13 | 8/31/20 (82) | |||||||||
14 | 10/27/20 (77) | |||||||||
15 | 2/02/21 (113) | |||||||||
16 | 2/20/21 (31) | |||||||||
17 | 3/07/21 (15) | |||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
D7:D11 | D7 | =C7-B7 |
E7:E11 | E7 | =TEXT(C7,"m/dd/yy") & " (" & D7 & ")" |
If I create a chart using this data, I get:
But I would like the x-axis labels to look like the data in E13:E17. To get it, I copied the values above and then manually inserted a linefeed (Alt+Enter). I cannot figure out how to get that linefeed into the expression so that E7:E11 look like E13:E17. That gives me this chart, which is what I want.
Is there a way to enter code for a linefeed in that expression? I do it in VBA using vbCrLf, but if I put that in the expression, I get a #NAME error.
Thanks