A family of Microsoft word processing software products for creating web, email, and print documents.
This will take a calculation field. The page number is part of the footer text. That is what you are attempting.
See Footer on last page.
For the one-page document, you could use the Different First Page setting.
Otherwise, you could use a more complex nested IF field where you first test for a single page.
Nested IF Fields - A method to create them
Edit: See third response below about using automatic Word feature of different headers and footers.]