Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in


How to border every 5/n rows in Excel?

Have you even wanted to select every 5/n row and then format them in a specific range in Excel? Actually there are many ways to solve this problem. Here I will introduce three methods to border every 5/n rows in a specific range in Excel.

Border every 5/n rows with Filter command in Excel

Border every 5/n rows with Conditional formatting in Excel

Border every 5/n rows with KTE's Select Interval Rows/Columns in Excel

Easily select every other (nth) row or column in a specified range in Excel

Kutools for Excel’s Select Interval Rows & Columns utility can help Excel users quickly select every other (or every nth) row/column from a selected range with ease. Full Feature Free Trial 60-day!

ad select interval rows

Excel Productivity Tools

Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial

Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately.60-day Unlimited Free Trial

We can add a help column to identify every 5/n row, and then filter these rows and add borders for them in Excel.

Step 1: In a blank column besides original range, type Rows into the first cell, enter formula =MOD(ROW(),5)=0 into the second cell (Cell E2 in our case), and then drag the Fill Handle to the range you want to apply this formula.

doc border every 5 row 1

Note: In the formula =MOD(ROW(),5)=0, 5 means every 5th row, and you can change it based on your needs.

Step 2: Select the Rows column, and then click the Data > Filter.

doc border every 5 row 2

Step 3: In the Rows column, click the arrow in the first cell, and then uncheck all options except the TURE option, and click the OK button. See below screen shot:

doc border every 5 row 3

Step 4: Select all filtered out rows except the heading row, and then click the arrow beside Border button > All Borders on the Home tab. See screen shot:

Step 5: Now delete the Rows column, and you will see all borders are added to every 5th row at once.

We can also apply the Conditional Formatting command to border every 5/n row in Excel.

Step 1: Select the range you want to border every 5/n row in Excel.

Step 2: Click the Conditional Formatting > New Rule on the Home tab. See screen shot below:

doc border every 5 row 6

Step 3: Now in the New Formatting Rule dialog box, you need:

(1) Click to highlight Use a formula to determine which cells to format in the Select a Rule Type box;

(2) In the Format values where this formula is true box, enter the formula =MOD(ROW(),5)=0 ;

(3) Click the Format button.

doc border every 5 row 7

Step 4: In the Format Cells dialog box, go to the Border tab, specify a line style, click to highlight the Outline button, and click the OK button.

Note: To color the border, you can click the Color box in the Line section and select a color from the drop down list in the Format Cells dialog box.

Step 5: Click the OK button in the New Formatting Rule dialog box.

Then you will see every 5th row are added with specified borders.

Actually we can select every 5th row with Kutools for Excel's Select Interval Rows & Columns utility, and then add borders to selected rows easily in Excel.

Kutools for Excel - Combines more than 300 Advanced Functions and Tools for Microsoft Excel

Step 1: Select the range you want to border every 5/n row in Excel.

Note: For example we want to border every 5th row in the Range A1:D20, we should select the range A5:D20.

Step 2: Click the Kutools > Select > Select Interval Rows & Columns.

doc border every 5 row 01

Step 3: In the Select Interval Rows & Columns dialog box, check Rows option in the Select section, type 4 into the Interval of box, type 1 into the Rows box, and click the OK button. See screenshot above:

Now, every 5th row is selected at once in the selected range.

Step 4: Go to Home tab, and click the arrow beside Border button > All Borders. See screen shot below:

Then you will see borders are added to every 5th row immediately.

In this Video, the Kutools tab and the Kutools Plus tab are added by Kutools for Excel. If need it, please click here to have a 60-day free trial without limitation!

Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 80% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.