Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Creating Two-Line Custom Formats.

Creating Two-Line Custom Formats

Written by Allen Wyatt (last updated November 7, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003


6

Excel is quite flexible in how it allows you to set up custom formats for displaying all sorts of values. Most custom formats are straightforward and easy to figure out, once you understand how custom formats work. (Custom formats and how to set them up has been discussed fully in other issues of ExcelTips.)

What if you want to create a two-line custom format, however? For instance, you may want to format a date so that the abbreviated day of the week and day of the month is on the first line, followed by the unabbreviated name of the month on the second line. Using such a format, a date would appear in a single cell in this manner:

Sat 4
March

Most of this can be done by the custom format "ddd d mmmm", but you need to figure out a way to add a line break between the "d" and the "mmmm". Excel won't let you press Alt+Enter between them, which is what you normally do to add a line break.

The solution is to use the numeric keypad to enter the desired line break in the format. Follow these steps to set it up:

  1. Select the cells you want to format.
  2. Choose Cells from the Format menu. Excel displays the Number tab of the Format Cells dialog box.
  3. In the Category list, choose Custom. (See Figure 1.)
  4. Figure 1. The Number tab of the Format Cells dialog box.

  5. Delete whatever is in the Type box.
  6. Type "ddd d" without the quote marks.
  7. Hold down the Alt key while you press 0010 on the numeric keypad. This enters the line feed character, and it looks like the portion of the format you typed in step 5 disappears. It is not really gone; it has just moved up above what can be displayed in the Type box.
  8. Type "mmmm" without the quote marks.
  9. Click the Alignment tab. (See Figure 2.)
  10. Figure 2. The Alignment tab of the Format Cells dialog box.

  11. Make sure the Wrap Text check box is selected.
  12. Click OK.

After setting up the format in this manner, you will need to adjust the row height of the formatted cells so that the entire two lines of the date will display.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2895) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Creating Two-Line Custom Formats.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Turning the Legend On and Off

When you create a chart in Excel, the program may automatically add a legend that explains the contents of the chart. In ...

Discover More

Suppressing Zero Values in PivotTables

PivotTables are great for digesting and analyzing huge amounts of data. But what if you want part of that data excluded, ...

Discover More

Remembering Workbook Settings from Session to Session

You can spend a lot of time getting your workbook to look "just right." Wouldn't it be great if Excel was able to ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (menu)

Changing Fonts in Multiple Workbooks

If you need to change fonts used in a lot of different workbooks, the task can be daunting, if you need to do it ...

Discover More

Checking All Cell Formatting in VBA

When your macro checks the formatting used for a cell, it needs to be careful that the type of formatting being checked ...

Discover More

Shortcut Key for Format Painter

The Format Painter is great for copying formatting from one cell to another. If you don't want to grab the mouse to use ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

2022-11-13 06:58:43

Alex Blakenburg

To overcome the with the width issue that is frequently mentioned. The below worked for me on MS 365.
• Go into Format Cells > Alignment
• Turn Wrap text off (uncheck), if it is already checked
• Turn on Shrink to fit
• Turn Wrap text on
You should now be able to shrink the column to suit the text without it turning into ####


2022-06-02 03:40:25

Luke

Many thanks - that worked (almost) perfectly. I noticed that when I adjust the column width Excel doesn't recognize the line break and assumes the full character width (regardless of the line break). If I narrow the width I get the formatting showing as "**************".

Thanks once again


2020-12-01 12:11:04

Joe

Thanks for the tip. Problem is that column width can not be set to less than full length format, display becomes ####... negating the value of multi-line display.


2020-11-24 04:39:41

Rick Rothstein

You discovered the downside of this custom format... Excel displays it on two lines but sees it a single line of text and calculates the required cell width based on that. The only way to minimize the effect after auto-sizing the column width is to set the cell's horizontal alignment to center align, then it won't look as bad.


2020-11-23 12:14:29

Lee Wylie

I was looking to make my date narrower as I've got a workbook with data in columns by date, and management wanted the date reformatted to fit more on screen without reducing zoom. They requested this;

ddd d
mmm yy

Which would display as

Mon 23
Nov 20

This tip works in terms of displaying the text over 2 lines, which is great - however I cannot get the text to display correctly if I narrow the column width to fit the new date format, it just displays the ###### placeholder. When I autofit the columns, it adds a huge amount of white space either side, so this formatting method won't work for me.

To overcome this I had to hide the row containing dates, and use a formula;

=TEXT(B1,"ddd d") & char(10) & TEXT(B1,"mmm yy")

It's not elegant but it works.


2020-11-07 10:07:23

Rick Rothstein

Two comments about Step 6 in your tip...

1) Instead of typing ALT+0010 you can type CTRL+J and it will work the same way.

2) On my version of Excel, what I typed does not disappear when I type either of the keystrokes in #1 above; rather, the cursor seems to disappear... actually it has moved below the displayed field (if you look carefully, you can see what looks like a single blinking dot... that is the top of the blinking cursor that is now below the bottom of the Type textbox). While you cannot see what you are typing down there, you can watch the results of your typing in the Sample textbox.


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.