Page number function

Many a times, it is required to know what the current page number of a particular cell by using a cell variable/function. For example, while preparing a detailed estimate, the page number of the data is to be known to the linked sheet. To achieve that a function namely PageNo() is necessary. For example, suppose the value in a cell “sheet3.x1111” (suppose it is in the 21st page) is to be referenced in “sheet 1” cell "A1"then we can easily use with a simple equation “=sheet3.x1111” in “sheet1.A1”, we get whatever value in that cell. But to get the page number also of that cell in a cell “A2” in “sheet1”, then there should be an equation/function something like “=PageNo(sheet3.x1111)” such that it returns the page no (here 21)

Calc sheets are not divided into pages. This would depend very much on your Print setup.
So what is wrong with Sheet No. Column () Row No. then show the Row and Column headers when printing.?

Perhaps what you want is set up a table of contents with the page reference. I think it could be affordable with some little trick.

Hi Tinkerer,
Let me clarify : when we use pagebreak view in the view menu, we get a watermarked page numbers in each page. What I need is that page number in a cell (within that page or any other cell outside) . For a better understanding I shall clarify this further : what i require is that THE value of the watermarked page number be available in a cell in THAT page eg. A1 cell the outcome of (intended function) should return 1 and suppose there is a page break and second page starts at A2 then in the cell THE fn. should return 2.

Point taken. Does your page size vary?

Hi Tinkerer, Suppose my page style changes then the page size and the number of pages will also naturally be changing as we can see in page-break view (in the view view menu) as also the page number changes.
what I require is the page number while in page break view be available in a cell- hope it is clear. what i mean is to catch the water-marked page numbers while in the page break view to a cell within that page

Hi @ahamed, if you set up manually the page breaks (Menu/Insert/Page break - row), adding a MAX() function in a cell on the first row of every page, or if you have a repeat value in a cell on a first row of every page, a COUNTIF() can help.
Attached a sample file.PageNumberWorkaround.ods

Hi Mariosv, thank you for ur answer, but my requirement is to automate not manually setting the page

Ahamed