how to insert page number in excel

How to Add Page Numbers in Excel

By Thomas Martinez
AD

Ever found yourself wishing you could add page numbers to your Excel documents for easy referencing or printing? You're not alone. Excel doesn't have a built-in page number feature, but with a simple equation, you can make it show page numbers just like in Word. Here's how to insert page numbers in Excel.

Before we dive into the steps, ensure you're using a version of Excel that supports thecells() function (Excel 2010 and later). Let's explore two common situations: when you want page numbers for the entire worksheet and when you want them for specific print areas.

Adding Page Numbers to the Entire Worksheet

To add page numbers to the entire worksheet, you'll need to adjust the scale to fit settings and use a formula to insert the page numbers.

AD
How to Insert Page Number in Excel (7 Easy Methods) - ExcelDemy
How to Insert Page Number in Excel (7 Easy Methods) - ExcelDemy
How to Insert Page Numbers in Excel (Easy Step-by-Step)
How to Insert Page Numbers in Excel (Easy Step-by-Step)
How to Insert Page Number in Excel (7 Easy Methods) - ExcelDemy
How to Insert Page Number in Excel (7 Easy Methods) - ExcelDemy

First, click on File > Print, then under Scaling, select 'Fit to 1 page wide' or 'Fit to 2 pages wide' to set your desired page layout. Then, place your cursor where you want the page numbers to appear. For example, if you want them in the footer, click on Page Layout > Footer, then click the center button to position your cursor.

Using the ROWS Function

The ROWS function returns the number of rows in a table or range. We'll use this to insert page numbers using a simple equation. Type the following formula into the cell where you want the page number to appear:

Word 2016 - Page Numbers Starting from Specific Number - How to Add Insert Start Put on Pages in MS
Word 2016 - Page Numbers Starting from Specific Number - How to Add Insert Start Put on Pages in MS
How to Insert Page X of Y into a Header or Footer in Excel
How to Insert Page X of Y into a Header or Footer in Excel

=IF(ROWS($1:1)>1,PAGE, "")

$1:1) tells Excel to look at all the rows above the current row where the formula is placed. The IF statement makes sure not to display a page number on the first page. The PAGE function returns the current page number.

AD

Formatting and Updating Page Numbers

To make the page number appear as you expect, format the cell as a number with no decimal places. As you add or remove rows or columns, the page numbers will update automatically, thanks to Excel's relative referencing.

If you want the page numbers to be centered like the default in Word, you can add a middle dot (·) before and after the formula like this: =·IF(ROWS($1:1)>1,PAGE, "")·

Adding Page Numbers to Specific Print Areas

Sometimes, you might only want to add page numbers to a specific range or print area within your worksheet. Here's how to do that:

AD

First, select the range or print area where you want the page numbers. Then, go to Page Layout > Print Area, and click on 'Set Print Area'. This sets the boundaries for the page numbers.

Using the ROWS Function with the Current Region

To ensure the page numbers correspond to the correct range, use the ROWS function with the CurrentRegion property. Place your cursor in the cell where you want the page number to appear, and type the following formula:

=IF(ROWS(CurrentRegion)>1,PAGE, "")

AD

This tells Excel to count the number of rows in the selected range or print area and apply the page numbers accordingly.

Formatting and Updating Page Numbers

Format the cell as a number with no decimal places, and ensure it's centered if desired. As you add or remove data within the print area, the page numbers will adjust automatically based on the current range.

There you have it! With these simple steps, you can add page numbers to your Excel documents easily. Now you can print your worksheets with confidence, knowing that the page numbers will be there to help you keep track of your precious data. Happy inserting!

AD