curatedapi
Browse the docs

Guides

Finance

Excel functions

Late payments

E-invoices

Accounting

Number checks

VAT and GST

Billing and pricing

Money and currencies

Dates and time

Math

Unit conversion

Everyday

Health

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

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).

InputTypeDescription
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.

ResultTypeDescription
datedate (YYYY-MM-DD)The last day of the target month.
serialintegerExcel's serial number for the date.

Examples

Microsoft's example: end of the next month

Requestcurl
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
  }'
200 OKResponse
{
  "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

Requestcurl
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
  }'
200 OKResponse
{
  "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.