Function Problems

Excel Formula to Calculate Gestational Age in Weeks and Days

Steve KSteve K Oct 16, 2026 870 views

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.

How to Calculate Gestational Age in Weeks and Days Using an Excel Formula
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'.
Before you start

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.

Solution 1Recommended

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.

1
Enter the LMP Date

Input the Last Menstrual Period date into a specific cell, for example, B2.

2
Select the Target Cell

Click on the cell where you want the calculated gestational age to be displayed.

3
Input the Formula

Type the following formula: =ROUNDDOWN((TODAY()-B2)/7,0)&" weeks "&MOD(TODAY()-B2,7)&" days"

4
Apply and View Result

Press Enter to execute the formula. The cell will now display the current gestational age in the specified format.

Use the ROUNDDOWN and MOD Formula
Automatic Daily Updates: Because this formula uses the TODAY() function, your gestational age calculation will automatically refresh and update each day without any manual adjustments.
Smart Date Tracking

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. 1. Install WPS Office: Download and install WPS Office on your preferred device.
  2. 2. Open a Spreadsheet: Launch WPS Spreadsheet and create a new blank workbook.
  3. 3. Input Your Date: Enter your LMP date into cell B2 and ensure it is formatted as a date.
  4. 4. Apply the Formula: Paste the gestational age formula into an empty cell.
  5. 5. Get Instant Results: Press Enter to see your gestational age automatically calculated in weeks and days.
100% compatible with Microsoft Excel formats (.xlsx) and all standard formulas.Includes intuitive Date and Time functions for precise tracking and calculations.Lightweight, completely free to use, and runs smoothly on Windows, Mac, and mobile devices.
microsoft office alternative - wps office

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.