Function Problems

Excel Formula to Return the First or Sixteenth of Each Month

Steve KSteve K Oct 23, 2026 869 views

Question details

Calculate the 16th of the current month for dates between the 1st and 15th, and the 1st of the next month for later dates.

How to Return the First or Sixteenth of Each Month Using an Excel Formula
Product
Excel
Device & OS
not provided
Scenario
Automating semi-monthly date calculations for payroll, billing cycles, or deadline tracking based on a starting date.
Observed behavior
The user needs an automated formula to evaluate a specific date and output the correct upcoming semi-monthly cutoff date.
Before you start

Ensure that your original starting dates are formatted as proper Excel Date values and not stored as text, as text values will cause the formula to return an error.

Solution 1Recommended

Use the IF and EOMONTH Formula to Calculate the Semi-Monthly Date

This method uses the IF function to evaluate the day of the month and combines the DATE and EOMONTH functions to generate the correct future date.

By combining logical evaluation with date calculation functions, you can automate semi-monthly schedules.

The formula checks whether the day of your source date is 15 or less. If it is, it artificially constructs the 16th of that same month and year. If the day is greater than 15, it uses the End of Month (EOMONTH) function to find the last day of the current month and simply adds 1 to land exactly on the 1st of the following month.

1
Select a destination cell

Click on an empty cell (for example, B2) adjacent to the cell containing your original date (for example, A2).

2
Enter the formula

Type the following formula exactly as shown: =IF(DAY(A2)<=15,DATE(YEAR(A2),MONTH(A2),16),EOMONTH(A2,0)+1)

3
Apply the calculation

Press the Enter key. The cell will populate with the calculated value.

4
Format the result as a date

If the result displays as a 5-digit number, right-click the cell, choose 'Format Cells', navigate to the 'Number' tab, select 'Date', and choose your preferred date format.

Use the IF and EOMONTH Formula to Calculate the Semi-Monthly Date
Applying to multiple rows: Once the formula is correctly applied to the first cell, you can click and drag the fill handle (the small square at the bottom-right corner of the cell) downwards to apply the calculation to an entire column of dates.
Manage Dates Easily in WPS Office

Calculate Semi-Monthly Dates Seamlessly with WPS Spreadsheet

WPS Office offers a powerful, user-friendly spreadsheet tool that fully supports all advanced Microsoft Excel date and logic formulas, including IF, DATE, and EOMONTH. You can easily manage payrolls, billing cycles, and complex date calculations without missing a beat.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the document containing the dates you need to evaluate.
  2. 2. Input the date formula: Select an empty cell next to your target date and type =IF(DAY(A2)<=15,DATE(YEAR(A2),MONTH(A2),16),EOMONTH(A2,0)+1).
  3. 3. Format and apply: Press Enter to execute the formula, ensure the cell is formatted as a Date, and drag the fill handle down to apply it to the rest of your list.
Fully compatible with Microsoft Excel (.xlsx) file formats.Comprehensive support for advanced logical and date formulas.Familiar user interface ensuring zero learning curve.Free, lightweight, and fast-loading spreadsheet solution.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my formula return a random five-digit number instead of a date?

Excel stores dates as sequential serial numbers for calculation purposes. If your formula returns a number like 45216, it is calculating correctly but displaying in a 'General' format. To fix this, right-click the cell, select 'Format Cells', choose the 'Date' category, and apply.

Can I modify the formula to return the 15th and the last day of the month instead?

Yes. To return the 15th for dates on or before the 15th, and the exact last day of the current month for dates after, use this variation: =IF(DAY(A2)<=15,DATE(YEAR(A2),MONTH(A2),15),EOMONTH(A2,0)).

Why is the EOMONTH function returning a #NAME? error?

A #NAME? error typically indicates a typo in the formula name. Ensure you have spelled EOMONTH exactly as written, without any extra spaces. Also, verify that the referenced cell contains a valid date and not text.