Excel Formula to Calculate Gestational Age in Weeks and Days
Question details
The user needs to calculate the gestational age based on a Last Menstrual Period (LMP) date and display the exact duration in weeks and days.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- A user wants to track pregnancy progress by calculating the exact gestational age dynamically from a starting date.
- Observed behavior
- The user aims to input an LMP date and use a formula to display the result automatically formatted as 'X weeks Y days'.
Ensure you have the exact date of the last menstrual period (LMP) entered into a cell and properly formatted as a valid Date in your spreadsheet.
Use the ROUNDDOWN and MOD Formula
This method calculates the exact weeks and remaining days by subtracting the LMP date from the current date.
This formula relies on the TODAY() function to dynamically update the gestational age every time you open the spreadsheet on a new day. It uses ROUNDDOWN to find the complete weeks and MOD to find the remaining days.
Input the Last Menstrual Period date into a specific cell, for example, B2.
Click on the cell where you want the calculated gestational age to be displayed.
Type the following formula: =ROUNDDOWN((TODAY()-B2)/7,0)&" weeks "&MOD(TODAY()-B2,7)&" days"
Press Enter to execute the formula. The cell will now display the current gestational age in the specified format.

Alternative: Use INT and MOD Functions
A slightly shorter formula alternative using the INT function to extract the whole number of weeks.
Calculate Dates and Complex Formulas Easily with WPS Office
Use WPS Spreadsheet to effortlessly manage medical records, personal trackers, and date calculations with hundreds of built-in functions perfectly compatible with Microsoft Excel.
- 1. Install WPS Office: Download and install WPS Office on your preferred device.
- 2. Open a Spreadsheet: Launch WPS Spreadsheet and create a new blank workbook.
- 3. Input Your Date: Enter your LMP date into cell B2 and ensure it is formatted as a date.
- 4. Apply the Formula: Paste the gestational age formula into an empty cell.
- 5. Get Instant Results: Press Enter to see your gestational age automatically calculated in weeks and days.

Frequently Asked Questions
How do I calculate gestational age on a specific past date instead of today?
To calculate gestational age on a specific historical date, replace the TODAY() function in the formula with the cell reference containing your target date (e.g., C2). The modified formula becomes: =ROUNDDOWN((C2-B2)/7,0)&" weeks "&MOD(C2-B2,7)&" days".
Why does my formula return a #VALUE! error?
This error generally occurs if the LMP date cell is stored as plain text rather than a recognized date. Select the cell containing the date, right-click, choose 'Format Cells', and ensure it is explicitly set to a standard 'Date' format.
How can I calculate the Estimated Due Date (EDD) alongside gestational age?
You can calculate the standard Estimated Due Date by simply adding 280 days (40 weeks) to the LMP date. In an adjacent cell, enter the formula =B2+280 (assuming B2 holds the LMP date) and format that cell as a Date.




