Excel EOMONTH function: end of month API
The last day of the month a number of months before or after a date, as Excel's EOMONTH.
POST https://api.curatedapi.com/v1/calc/excel/eomonth
- Version 1
- MCP tool
calc_excel_eomonth - Try it in the browser
EOMONTH(start_date, months).
Formula
last day of (start_date's month + months)
- Arguments are named and ordered as in Excel. Excel computes in binary floating point; this API computes the exact value of the same formula and rounds it once, so it agrees with Excel to the digits Excel can show, and where Excel's own rounding error reaches the 15th digit this answer is the correct one.
- Dates are ISO 8601 (YYYY-MM-DD) from 1900-03-01 to 9999-12-31, so Excel's fictional 29 February 1900 never comes into play. Each date result also gives Excel's serial number (1900 date system).
Inputs
Send numbers as strings to keep every digit. options sets precision and rounding (see numbers and rounding).
| Input | Type | Description |
|---|---|---|
start_date required |
date (YYYY-MM-DD) | Start date. |
months required |
integer | Months to move: positive for later, negative for earlier. Allowed: >= -120000 and <= 120000. |
options.rounding |
half_even | half_up | half_down | up | down | ceiling | floor | Rounding mode applied once to each result. Default half_even. |
options.decimals |
integer | Round results to this many digits after the decimal point. |
options.significant_digits |
integer | Round results to this many significant digits. |
Result
Under result in the answer, next to exactness, precision, inputs, formula, references and warnings.
| Result | Type | Description |
|---|---|---|
date | date (YYYY-MM-DD) | The last day of the target month. |
serial | integer | Excel's serial number for the date. |
Examples
Microsoft's example: end of the next month
curl https://api.curatedapi.com/v1/calc/excel/eomonth \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"start_date": "2011-01-01",
"months": 1
}'
{
"calculator": "excel/eomonth@1",
"result": {
"date": "2011-02-28",
"serial": 40602
},
"exactness": {},
"precision": {
"rounding": "half_even",
"decimals": 0
},
"inputs": {
"start_date": "2011-01-01",
"months": 1
},
"formula": "last day of (start_date's month + months)",
"references": [
{
"title": "Microsoft Excel EOMONTH function",
"url": "https://support.microsoft.com/en-us/excel/functions/eomonth-function"
}
],
"warnings": []
}
Microsoft's example: end of the month three months earlier
curl https://api.curatedapi.com/v1/calc/excel/eomonth \
-H "Authorization: Bearer $CURATEDAPI_KEY" \
-H "Content-Type: application/json" \
-d '{
"start_date": "2011-01-01",
"months": -3
}'
{
"calculator": "excel/eomonth@1",
"result": {
"date": "2010-10-31",
"serial": 40482
},
"exactness": {},
"precision": {
"rounding": "half_even",
"decimals": 0
},
"inputs": {
"start_date": "2011-01-01",
"months": -3
},
"formula": "last day of (start_date's month + months)",
"references": [
{
"title": "Microsoft Excel EOMONTH function",
"url": "https://support.microsoft.com/en-us/excel/functions/eomonth-function"
}
],
"warnings": []
}
References
Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.
Errors share one format; see errors. Billing, retries and batches work the same for every endpoint.