Math and trigonometry functions

EVEN

Refuses 2 of 1,373 recorded calls; the rest match

Of 1,373 recorded answers (1,227 in the answer bank and 146 workbook cells), 2 do not match: 2 are refused. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicEVEN
BulgarianEVEN
CzechZAOKROUHLIT.NA.SUDÉ
DanishLIGE
GermanEVEN
GreekEVEN
English (Australia)EVEN
English (United Kingdom)EVEN
English (United States)EVEN
SpanishREDONDEA.PAR
EstonianEVEN
FinnishPARILLINEN
FrenchPAIR
HebrewEVEN
CroatianEVEN
HungarianPÁROS
IndonesianEVEN
ItalianEVEN
JapaneseEVEN
KoreanEVEN
LithuanianEVEN
LatvianEVEN
NorwegianAVRUND.TIL.PARTALL
DutchEVEN
PolishZAOKR.DO.PARZ
Portuguese (Brazil)EVEN
Portuguese (Portugal)PAR
RomanianEVEN
RussianЧЁТН
SlovakEVEN
SlovenianEVEN
Serbian (Latin)EVEN
SwedishJÄMN
ThaiEVEN
TurkishÇİFT
UkrainianEVEN
VietnameseEVEN
Chinese (Simplified)EVEN
Chinese (Hong Kong)EVEN
Chinese (Traditional)EVEN

Names from Microsoft's support site.

What it does

EVEN(number)

EVEN(number) rounds its argument to an even integer, moving away from zero. Microsoft's page states the rule in exactly that form: regardless of the sign, the adjustment is away from zero, and an argument that is already an even integer is not moved.

In closed form:

EVEN(x) = 2 · sign(x) · ceil( ABS(x) / 2 )      for x ≠ 0
EVEN(0) = 0
PropertyStatement
Domainall real x
Rangethe even integers representable as doubles
Parity of the mapodd: EVEN(-x) = -EVEN(x)
IdempotentEVEN(EVEN(x)) = EVEN(x)
Monotonenon-decreasing
Step2 — the function is a staircase with treads of width 2, not 1
Fixed pointsexactly the even integers
BoundABS(EVEN(x)) ≥ ABS(x), with equality only at the fixed points
Identity above 2^53EVEN(x) = x for every double with ABS(x) ≥ 2^53

The last row is the one that surprises people, and it is pure format arithmetic rather than function design. Above 2^53 the spacing between consecutive doubles is at least 2, so every representable value in that range is already an even integer. EVEN is therefore the identity map on the entire upper half of the format's range, and the function only does anything at all below 2^53.

The half-open-interval reading is worth keeping in mind: EVEN maps (0, 2] to 2, (2, 4] to 4, and symmetrically on the negative side. The endpoints belong to the lower tread because an even integer is not moved.

Arguments

ArgumentMeaningNotes
numberThe value to round. Required.Microsoft documents no constraint

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

Returns Number, always an even integer.

  • Zero — EVEN(0) is 0. Zero is even, so no adjustment is required, and the closed form above handles it as the degenerate case rather than as an exception.
  • Negative arguments — move away from zero: an argument between -2 and 0 becomes -2. This is the documented rule and it is the opposite of what "round up" would mean if read as "toward +∞". Microsoft's own wording — a value is rounded up when adjusted away from zero — is a definition of "up" as "away from zero", and the whole page turns on it.
  • Already-even integers — unchanged, documented explicitly.
  • Odd integers — move by exactly 1, away from zero.
  • Values already above 2^53 — unchanged, as above.
  • Signed zero — an argument of -0 is at a fixed point; whether the sign survives is not documented and has not been checked.

Errors

As documented on Microsoft's EVEN page:

ErrorCondition
#VALUE!number is non-numeric

No other error condition is documented, and none is structurally required: the function cannot overflow and has no domain restriction.

How to implement

Numerical notes

EVEN is one of the few functions in this batch that can be, and should be, exact.

Every step of the closed form is exact in binary64:

  1. ABS(x) is exact — a sign-bit clear.
  2. ABS(x) / 2 is exact — division by a power of two only changes the exponent, and it cannot underflow into the subnormal range in a way that loses bits unless x was already subnormal, where the result is 0 or 2 anyway.
  3. ceil is exact — it is an IEEE 754 roundToIntegral operation, which is by definition exactly rounded and, for a value already integral, the identity.
  4. Multiplying by 2 is exact, and cannot overflow: the input to this step is at most ceil(DBL_MAX/2), so the product is at most DBL_MAX.

So a correct implementation commits no rounding error at all on any argument, and any disagreement between two implementations of EVEN is a disagreement about the rule, never about the arithmetic. That is a rare and pleasant situation, and it means the interesting probes here are all about tie behaviour and sign conventions rather than about ulp.

Two traps for implementers:

  • Do not use 2 * ceil(x / 2) without the absolute value. For negative x, ceil rounds toward +∞, i.e. toward zero, which is the opposite of the documented rule. The sign must be factored out first and restored afterwards.
  • Do not test "is already even" by MOD(x, 2) = 0 on large arguments. Above 2^53 this is true of everything, which happens to be correct, but the test itself involves a division that is exact only because of the power of two; the same pattern with a non-power-of-two step is not exact, and the habit transfers badly to MROUND and CEILING.MATH.

The identity region above 2^53 deserves one more sentence, because it is a fact about the format that this function makes visible: a spreadsheet user who applies EVEN to a large identifier — an account number stored as a number, say — will see it returned unchanged and may conclude the function is broken. It is not; the value was already even, and had been since it crossed 2^53.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

EVEN · 1 lines · calc-func/src/catalogue/rounding.rs on GitHub
call(EVEN, "EVEN", 1, NUMBER, even)
even · 9 lines · calc-func/src/catalogue/rounding.rs on GitHub
/// EVEN: rounded away from zero to an even integer; an even integer is unchanged.
fn even(
    arguments: &[CalcValue],
    services: &mut EvalServices<'_>,
) -> Result<CalcValue, FunctionFault> {
    numeric(EVEN, arguments, services, |site, n| {
        to_parity(site, n[0], false)
    })
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.

Excel 16.0 buildPlatform and CPUCaptured inputs
19929Windows, bitness not recorded, CPU not recorded43
20430Windows, 64-bit, CPU not recorded1,227
  • XC-EVEN-001: build 19929 versus build 20430; 2 same-input pairs, 0 differing answers. Compared axes: excel-build. Numeric answers were compared by their recorded binary64 bits; other answers by typed value.

Agreement on these compared inputs does not establish agreement on unmeasured inputs.

Recorded environments and comparison details.

Excel 16.0 build 19929

Windows, bitness not recorded, CPU not recorded

43 captured inputs are indexed for this environment. Capture dates are not recorded. This is a reading count, not a comparison with another build.

Excel 16.0 build 20430

Windows, 64-bit, CPU not recorded

1,227 captured inputs are indexed for this environment. Capture dates: 2026-09-29 to 2026-09-29. This is a reading count, not a comparison with another build.

Alternatives

Relationships

  • ODD — the parity partner, rounding away from zero to an odd integer. The pair is not symmetric: ODD has no fixed point at zero (ODD(0) is documented as 1) and its identity region above 2^53 does not exist, because no double above 2^53 is odd. That asymmetry makes ODD the more interesting of the two at the top of the range and EVEN the more interesting at the bottom.
  • CEILING.MATH — the general away-from-zero-or-toward--∞ rounding. CEILING.MATH(x, 2, 1) is the away-from-zero reading and coincides with EVEN there; CEILING.MATH(x, 2) with the default mode rounds negatives toward -∞ and does not match EVEN. Substituting one for the other on a column containing negatives changes results.
  • FLOOR.MATH, FLOOR.PRECISE — the downward family, for contrast: they round toward -∞, where EVEN rounds away from zero. The worksheet's rounding functions do not share a single direction convention, and knowing which convention a given one uses is most of the skill in choosing between them.
  • ROUNDUP — rounds away from zero to a digit position, the same direction convention as EVEN with a different grid.
  • MROUND(x, 2) — rounds to the nearest multiple of 2 rather than away from zero, so it disagrees with EVEN on every argument in the lower half of each tread.
  • ISEVEN — the predicate, which tests parity rather than producing it, and which truncates rather than rounding.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents