Loading
Excel.Tips.Net ExcelTips (Menu Interface)

Creating Two-Line Custom Formats

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.

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.

Related Tips:

Solve Real Business Problems Master business modeling and analysis techniques with Excel and transform data into bottom-line results. This hands-on, scenario-focused guide shows you how to use the latest Excel tools to integrate data from multiple tables. Check out Microsoft Excel 2013 Data Analysis and Business Modeling today!

 

Leave your own comment:

*Name:
Email:
  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*Text:
*What is 5+3 (To prevent automated submissions and spam.)
 
 
           Commenting Terms

Comments for this tip:

Poser2662    23 Jun 2016, 09:23
This worked PERFECTLY!!!!! Thank you!
Thomas    20 Oct 2015, 11:19
Hello, I have been looking for a solution to this for a long time. But could you be a little more clear on this? May be do a video?

"Type "ddd d" without the quote marks.
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.
Type "mmmm" without the quote marks."
Ken    20 Sep 2015, 03:20
I received an audible error when I tried pressing "Alt" and entering numbers in the "Type:" field under custom number format.I was only able to get this to work by turning on "Num Lock" and using the numbers under the letters. I do not have a full keyboard. I only have the numbers at the top (not a separate set of numbers/keypad on the right.)
Mitch    25 Mar 2015, 15:33
After Paula commented, I went back and tried chepox's simple instructions.

This time it worked -- hurrah!
I may not have executed his/her instructions properly earlier.

So I'm a happier camper now.

Thanks everyone.
Paula    24 Mar 2015, 13:42
This worked perfectly for me once I came back and read the bit about shrink fit! Thanks!
Carlos    06 Mar 2015, 06:38
What chepox wrote worked for me!

Thanks
Mitch    08 Oct 2014, 09:21
Chepox and Michael,

Thanks for your helpful comments.

But after following them closely, they still don't allow me to shrink the column to actual width of the custom-format-wrapped text.

I get the usual unfriendly "########" display when shrinking the column even a tiny bit past the auto-shrinked width.

So the column still remains considerably wider than it needs to be.

I'm using Excel 2010 in Windows 7.

Thanks everyone.
chepox    07 Oct 2014, 13:20
Mitch,
You need to uncheck wrap text for the selected cell then select shrink to fit, afterwards, check wrap text back again. Now you can shrink the columns to the actual size of the text per line.
Michael (Micky) Avidan    07 Aug 2014, 07:53
@mitch,
It is very easy to define a small Event-Macro to AutoFit the column.
Assuming you are dealing with Columns A,B,C - all you ned is to type the following macro into the Sheet Module:
****************
Private Sub Worksheet_Change(ByVal Target As Range)
     If Intersect(Target.Columns, Columns("A:C")) Is Nothing Then Exit Sub
     Target.Columns.AutoFit
End Sub
*********
Michael (Micky) Avidan
“Microsoft® Answers" - Wiki author & Forums Moderator
“Microsoft®” MVP – Excel (2009-2015)
ISRAEL

mitch    06 Aug 2014, 11:41
This tip gives a "line feed" (as "advertised") but the width the column needs to display the text is still the same (I'm using Excel 2010)

Thus, one cannot use this method to reduce the width of a column (a prime motivator for wrapping text).

thanks
Michael (micky) Avidan    14 Jul 2013, 08:10
@ machados soares,

Portable Computers have a special Fn key (usually in Blue) which toggles 10 keys on the keyboard to behave as the similar to the "Num Pad".

Ask your support dept. and/or check the Portable User guide/Manual.

Michael Avidan
“Microsoft®” MVP – Excel
ISRAEL
machados soares    13 Jul 2013, 11:09
This tip doens't work on my portable.
I have windows 7 and excl xlsx.
I do everything inicated on the tip but it doens,t work.
Coul you help me please?
 
 

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us

 

Advertise with Us

Our Privacy Policy

Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2016)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2016)

Our Products

Helpful E-books

Newsletter Archives

 

Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2016 Sharon Parq Associates, Inc.