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: Dealing with Long Formulas.

# Dealing with Long Formulas

by Allen Wyatt
(last updated January 26, 2016)

Anyone who has been using Excel for any length of time knows that some formulas can get quite long. Excel handles them—as long as they are constructed correctly—but they can be a bear for humans to understand. Even after you develop your own formulas, you may have trouble understanding them weeks or months later.

One way to make formulas a bit easier to understand is to use Alt+Enter in the middle of the formula to "format" how it appears on the screen. Consider, for instance, the following long formula:

```=+IF(\$A2=0,0,IF(\$B2<4264,0,IF(AND(\$B2>=4264,\$B2<=4895),
(-22.31*\$C2/365),IF(AND(\$B2>=4895,\$B2<=32760),(\$B2*0.093-
476.89)*\$C2/365,IF(\$B2>32760,(\$B2*0.128-1623.49)*\$C2/365)))))
```

This formula could also be written in the following manner, with Alt+Enter being pressed at the end of each line in the formula:

```=+IF(\$A1=0,0,
IF(\$B1<4264,0,
IF(AND(\$B1>=4264,\$B1<=4895),(-22.31*\$C1/365),
IF(AND(\$B1>=4895,\$B1<=32760),(\$B1*0.093-476.89)*\$C1/365,
IF(\$B1>32760,(\$B1*0.128-1623.49)*\$C1/365)))))
```

Now, the broken-up formula appears on five lines, even though it all appears in a single cell. The broken-up formula works just as if it were all on one line.

In addition, if you copy the complete broken-up formula from the Formula bar and paste it into a worksheet, each line in the formula is pasted into a different cell, making it easy to test each part. This is much quicker than copying and pasting parts of the original formula.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3043) 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: Dealing with Long Formulas.

##### 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

Jumping to the Top of a Page

Do you want to easily jump to the top of a page in your document? You can use the Go To command to make the shift, or you ...

Discover More

Resetting Paragraph Formatting

Tired of the formatting used in a paragraph? One way to "start over" is to make sure that the formatting is reset to its ...

Discover More

Working on Shared Templates

In many companies it is common to have standard templates accessible through the internal network. If you have templates ...

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!

Selecting a Word

There are a few editing tricks you can apply in Excel the same as you do in Word. Selecting a word from the text in a ...

Discover More

Ensuring Standard Units During Data Entry

Need to make sure that information entered in a worksheet is always in a given unit of measurement? It's not as easy of a ...

Discover More

Reference Shortcut

Need to modify how a cell reference, in a formula, is constructed? The shortcut described in this tip will help you step ...

Discover More
##### Subscribe

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

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}] 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 9 - 4?

2018-04-11 09:59:07

Raghunath Dhungel

What is wrong with the following formula ?

=IF('1stTerm'!G9>='Record '!\$O\$1,'Record '!\$O\$2,
IF('1stTerm'!G9>='Record '!\$P\$1,'Record '!\$P\$2,
IF('1stTerm'!G9>='Record '!\$Q\$1,'Record '!\$Q\$2,
IF('1stTerm'!G9>='Record '!\$R\$1,'Record '!\$R\$2,
IF('1stTerm'!G9>='Record '!\$S\$1,'Record '!\$S\$2,
IF('1stTerm'!G9>='Record '!\$T\$1,'Record '!\$T\$2,
IF('1stTerm'!G9>='Record '!\$U\$1,'Record '!\$U\$2,
IF('1stTerm'!G9>='Record '!\$V\$1,'Record '!\$V\$2,
IF('1stTerm'!G9>='Record '!\$W\$1,'Record '!\$W\$2,'Record '!\$X\$2))))))))

2018-02-27 13:30:28

Doug Robinson

Mind blown!!
I've been using spreadsheet for 30 years and I never knew that!
Mind blown..

2017-03-14 20:14:15

Rob Long

Did not work... my formular is 31 lines long - each line 60 characters long.
I'm doing a formula on a serious of date ranges where each date range holds a title. Thus if something is >= <= the date range - the cell result will be the name of of the range.

2016-10-20 07:39:03

sitim

Hi there,

I got a long equation to fit in the excel.I have tried so many times but it never work. Can u pls help me with this?
= EXP[-1.803-0.976(-0.197)+0.976ln(0.560)+2.673ln(20.63)-0.0299[ln(20.63)^2]

Thanks.

##### 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.