Shade Alternate Rows in Excel (Table of Contents)
Introduction to Shade Alternate Rows in Excel
Whenever you are working with large datasets in excel, it is a practice that is common and you must have followed to shade the alternate rows with different colors. It makes the spreadsheet easy to read as well as visually appealing to the user. It is comparatively easy to shade alternate rows in a relatively small dataset and can be done manually. However, when you have data as large as the billions and trillions of entries, manual shading will never work. In this article, we will make you aware of some of the ways by which you can shade alternate rows with different colors in Excel.
We usually can do this task with three different ways:
- Using Excel’s Insert Table utility which automatically shades the alternate row.
- With help of Conditional formatting without using Helper Column.
- With help of Conditional formatting and using Helper Column.
Methods to Shade Alternate Rows in Excel
Let’s understand how to Shade Alternate Rows in Excel with some methods.
Method #1 – Shade Alternate Rows in Excel using Table Utility
Suppose we have data of 1000 rows as shown in the screenshot below. It is hard to manually shade each alternate row which consumes ample of the time. See the partial screenshot below:
Step 1: Select all the rows where you wanted to shade every alternate row.
Step 2: Navigate towards the Insert tab on Excel Ribbon and click on Table button present under Tables group. You also can do this by hitting Ctrl + T simultaneously.
Step 3: As soon as you click on the Table button, Create Table window will pop-up with the rows selection. Click OK button to apply table format on the selected rows.
Step 4: You also have an option to design your table in shades through the Design tab. You can navigate to more designs and create a custom design of your own as well.
Method #2 – Conditional Formatting without Helper Column
We also can use the conditional formatting to shade every alternate row in Excel. Follow the steps below:
4.9 (2,645 ratings)
Step 1: Highlight all non-empty rows by selecting them without header (because we want the header color to be different, It will help recognize the headers).
Step 2: Select the Home tab from the Excel ribbon and click on Conditional Formatting dropdown which is under the Styles group.
Step 3: Select New Rule… option from the Conditional Formatting dropdown.
As soon as you click it, you will see a new window named New Formatting Rule popping up.
Step 4: Inside New Formatting Rule window, select Use a formula to determine which cell to format rule under Select a Rule Type: option.
Step 5: Use formula as =MOD(ROW(),2)=1 under Formal Values where this formula is true box.
Step 6: Click on the Format button to add the color shades for the alternate rows.
Step 7: As soon as you Press the Format button, you’ll see a Format Cells window popping-up. Navigate to Fill option and change the background color as shown in the screenshot below. Once done, press the OK key.
You can see an output as shown below. Each cell with Odd number is shaded through the Excel sheet.
MOD() is a modulo function that can be used to find the modulus of a reminder when one number is divided by the other. For example, if we use MOD(3, 2), it means, when we divide the number 3 by number 2, it will give a reminder as 1. ROW() function gives the row number for each cell the formula runs on. The combination MOD(ROW(),2) = 1 check only those rows where a reminder is equals to 1 (meaning odd cells). Therefore, you can see all the odd rows are shaded. Similarly, you can shade all even rows. All you need to do is, tweak the formula as MOD(ROW(),2) = 0. This means all the rows which are divisible by 2 (in other words, all even rows will be selected and shaded).
Method #3 – Conditional Formatting with helper Column
Step 1: Insert a helper column named S.NO. in the table and add the serial numbers for each row in it.
Follow the steps as same from Step 1 to Step 4 as we used in previous example.
Step 2: Use formula as =ISODD(A2) under Formal Values where this formula is true box. This formula works on the same manner the previous one works in Example 1. It captures whether the value in cell A2 is odd or not. If it is odd, then it performs the operation we perform on that cell.
Step 3: Again, do the same procedure as we did in the previous example. Click on the Format button and select the appropriate color of your choice as a shade under the Fill section. Once done, press the OK button.
You can see an output as shown in the screenshot below.
These are the three easy methods using which we can shade the alternate rows in excel. Let’s wrap the things up with some points to be remembered.
Things to Remember About Shade Alternate Rows in Excel
- The easiest way to shade every alternate row in excel is by using the Insert Table option in Excel. It is simple, versatile, time-saving and has different designs that will give you different layouts.
- It is also possible to shade every 3rd, every 4th or so row. All you need to do is, just change the divisor from 2 to the respective number (3, 4, etc.) under the MOD formula which we use to define the row selection and row formatting logic.
- ISODD and ISEVEN functions can also be used. ISODD shades all the odd-numbered rows and ISEVEN shaded all the even-numbered rows.
- You also can shade even and odd cells with different colors. For that, you need to apply two conditional formattings.
This is a guide to Shade Alternate Rows in Excel. Here we discuss the Methods to Shade Alternate Rows in Excel along with and downloadable excel template. You can also go through our other suggested articles –