Three tricks for formatting rows in Excel

By David H. Ringstrom, CPA

I'm sure that you've worked with data sets in Excel where the information starts blurring together. In this article I discuss several techniques that I use avoid getting lost in the forest. First I'll briefly describe the Table feature in Excel 2007 and Excel 2010, and then share some conditional formatting tricks for anyone that's still using an earlier version of Excel.
It's easy to change the color of every other row in an Excel 2007 or Excel 2010 worksheet:
1.     Select a single cell within your list of data.
2.     Choose Format as Table from the Styles section of the Home ribbon, and then choose a color scheme, as shown in Figure 1.
3.     As shown in Figure 2, Excel will automatically determine the cell coordinates of your table. If you choose the My Table Has Headers option, then Excel will add Filter arrows at the top. As an added bonus, if your table is longer than what you can see on a single screen, your header row contents will move into the worksheet frame when you scroll down, as shown in Figure 3.
4.     To eliminate the table, choose Convert to Range in the Tools section of the Design tab that appears when you click on the table. The formatting remains in place, so to eliminate it you can either choose new formatting, or use the Clear Formatting command in the Editing section of the Home ribbon.
Figure 1: Excel 2007's Format as Table feature.
Figure 2: Excel automatically determines the cell coordinates of your table.
Figure 3: Your header row appears in the worksheet frame when you scroll beyond the first screen.
The Table feature is a fast way to format your data, but let's say that you need more control over your formatting, such highlighting your data in groups of 5. You can use the Conditional Formatting feature in Excel 2007 or 2010 to do so:
1.     Select the cells that you wish to format.
2.     Click the Conditional Formatting button in the Styles section of the Home ribbon, and then choose New Rule, as shown in Figure 4
Figure 4: Conditional Formatting appears on the Home tab of the ribbon.
3.     Select Use a Formula to Determine Which Cells to Format, and then enter this formula:
4.     Click the Format button to assign the formatting of your choice, and then click OK.
5.     As shown in Figure 5, alternating blocks of 5 rows will be highlighted.
Figure 5: Conditional formatting allows us to highlight data in blocks of 5 rows at a time.
Note: Use this formula with Conditional Formatting if you wish to highlight every other row:
In Excel 2003 or earlier, select the cells you wish to highlight, choose Format, and then Conditional Formatting. Change Condition 1 to Formula is and use one of the formulas shown above.
Here's a quick rundown of how these formulas work:
·         ROW returns the current row number. This function allows you to optionally specify an address argument. However, in this case we're referring to the current row, so there's no need to provide a cell address.
·         CEILING rounds the row number up to the next multiple of 5 (or whatever number you specify). There are two arguments: number, and significance. We use ROW() to provide the number, and significance is the multiple that we want to round the row number to.
·         MOD returns the remainder from a division calculation, and has two arguments: number and divisor. In the case of the first formula, the results of the CEILING function are divided by 2. This means that rows 1 through 5 would round up to 5, and since 2 does not divide evenly into 5, MOD returns 1. Since we added =0 to the end of our formula, the Conditional Formatting feature in turn formats rows where MOD returns 0 instead of 1. Thus rows 1 through 5 don't get formatted, while 6 through 10 do, while 11 through 15 don't, and so on.
About the author:
David H. Ringstrom, CPA heads up Accounting Advisors, Inc., an Atlanta-based software and database consulting firm providing training and consulting services nationwide. Contact David at or follow him on Twitter. David speaks at conferences about Microsoft Excel, and presents webcasts for several CPE providers, including AccountingWEB partner CPE Link.


You may like these other stories...

It's not a reality—yet—but accounting software is poised to eliminate accountants. We are at a tipping point for many similar professions: online education replacing professors, legal software replacing...
Whenever I speak to accountants about creating a cloud practice, the most common question is, “How do I charge my clients?” Ten years ago, maybe even five years ago, if I would’ve posed this question...
While reputational risk is the No. 1 nonfinancial concern among corporate directors, cybersecurity/IT risk is gaining steam. In fact, both private companies and organizations with more than $1 billion in revenue felt they...

Upcoming CPE Webinars

Jul 31
In this session Excel expert David Ringstrom helps beginners get up to speed in Microsoft Excel. However, even experienced Excel users will learn some new tricks, particularly when David discusses under-utilized aspects of Excel.
Aug 5
This webcast will focus on accounting and disclosure policies for various types of consolidations and business combinations.
Aug 20
In this session we'll review best practices for how to generate interest in your firm’s services.
Aug 21
Meet budgets and client expectations using project management skills geared toward the unique challenges faced by CPAs. Kristen Rampe will share how knowing the keys to structuring and executing a successful project can make the difference between success and repeated failures.