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.
by Allen Wyatt
(last updated December 29, 2018)
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.
Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!
Paste some information into a worksheet and Excel helpfully displays some options related t the paste operation. If you ...Discover More
When you copy and paste a formula, you usually want to see the formula where you pasted. If you don't get the formula, ...Discover More
The Clipboard is essential to move or copy information from one place in Excel to another. If you get an error when you ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.