Math and trigonometry functions

ODD

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

Of 1,374 recorded answers (1,227 in the answer bank and 147 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
ArabicODD
BulgarianODD
CzechZAOKROUHLIT.NA.LICHÉ
DanishULIGE
GermanODD
GreekODD
English (Australia)ODD
English (United Kingdom)ODD
English (United States)ODD
SpanishREDONDEA.IMPAR
EstonianODD
FinnishPARITON
FrenchIMPAIR
HebrewODD
CroatianODD
HungarianPÁRATLAN
IndonesianODD
ItalianODD
JapaneseODD
KoreanODD
LithuanianODD
LatvianODD
NorwegianODDETALL
DutchONEVEN
PolishZAOKR.DO.NPARZ
Portuguese (Brazil)ODD
Portuguese (Portugal)ÍMPAR
RomanianODD
RussianНЕЧЁТ
SlovakODD
SlovenianODD
Serbian (Latin)ODD
SwedishUDDA
ThaiODD
TurkishTEK işlevi
UkrainianODD
VietnameseODD
Chinese (Simplified)ODD
Chinese (Hong Kong)ODD
Chinese (Traditional)ODD

Names from Microsoft's support site.

What it does

ODD(number)

ODD(number) rounds number away from zero to the nearest odd integer.

Microsoft's two remarks give the rule completely:

"Regardless of the sign of number, a value is rounded up when adjusted away from zero."

"If number is an odd integer, no rounding occurs."

So the direction is outward from zero in both half-planes — 1.5 rises to 3, and −2 falls to −3 — and an argument already on an odd integer is returned unchanged. The documented examples pin all five cases: 1.5 → 3, 3 → 3, 2 → 3, −1 → −1, −2 → −3.

Written out:

ODD(x) = sign(x) · ( 2·⌈ (|x| − 1)/2 ⌉ + 1 )

Domain and range. Domain: all reals. Range: the odd integers — with two qualifications, one at zero and one at the top of the floating-point range, both below.

Shape. A staircase with steps of width 2 and jump 2, symmetric under x ↦ −x (the function is odd in the algebraic sense as well as in the arithmetic one: ODD(−x) = −ODD(x) away from zero). It is idempotent — ODD(ODD(x)) = ODD(x) — and it is the away-from-zero counterpart of EVEN, which does the same thing to an even lattice.

Arguments

ArgumentMeaningRequired
number"The value to round."Yes

Exactly one argument; the declared arity is one to one. The slot is numeric and subject to ordinary to-number coercion (coercion and lifting). The declared coercion profile is the unary numeric scalar-or-array-elementwise one, so ODD is a scalar kernel that lifts over arrays.

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 — an integer value.

  • Zero returns +1, as discussed above. Undocumented.
  • −1 is returned unchanged, matching the documented example.
  • A logical argument converts and rounds; numeric text converts and rounds.
  • The smallest positive subnormal rounds to 1 — every strictly positive value below 1 does.
  • An inline array lifts elementwise.
  • An empty range produces #VALUE!.
  • The largest finite double is returned unchanged — and it is an even integer. See below; this is not a rounding decision, it is a representability wall.

The postcondition fails above 2^53

ODD promises an odd result. Above 2^53 it cannot deliver one, and the reason is arithmetic rather than implementation.

Binary64 spaces consecutive representable values 2 apart in [2^53, 2^54), 4 apart in [2^54, 2^55), and so on. Every finite double of magnitude at or above 2^53 is an even integer, because it is a multiple of at least 2. There is no odd double above that point. So for any argument in that range:

  • returning the argument unchanged gives an even answer, violating the function's defining property; and
  • returning "the next odd integer" is impossible, because that integer is not representable — the nearest doubles either side are both even.

The same wall governs EVEN in mirror image, where the story is happier: above 2^53 every double already is even, so EVEN's postcondition survives exactly where ODD's fails.

Errors

ErrorConditionBasis
#VALUE!The argument is nonnumericDocumented: "If number is nonnumeric, ODD returns the #VALUE! error value."
propagatedAn error value in the argumentShared call model

There is no documented domain error, and none is needed: ODD is total on the reals.

How to implement

Numerical notes

ODD performs no transcendental work and, below the representability wall, no rounding of its own. Its numerical character comes from three places.

Discontinuity amplification. Like INT, ODD is a step function, so a sub-ULP error in its argument becomes a full step — here a jump of 2, not 1 — whenever the argument straddles a step boundary. The boundaries are the odd integers themselves: an argument that ought to be exactly 3 but arrives as the next double above 3 is rounded to 5. Anything computed and then passed to ODD should be rounded to an integer first if the intent was an integer.

The representability wall, described in full above. An implementation that computes 2*ceil((|x|-1)/2)+1 in floating point does not merely return an even number above 2^53 — the intermediate |x|-1 is itself a no-op there (subtracting 1 from a double spaced 2 apart returns the same double), so the formula degenerates to the identity. That the naive formula and the correct-by-convention answer coincide is a coincidence, not a design, and an implementation that converts through a fixed-width integer instead will produce something different — or wrap — at the same inputs.

The sign of zero. ODD(-0.0) has an argument whose sign bit is set but whose value is zero, so the "away from zero" direction is even less determined than at +0. Whether an implementation consults the sign bit is a decision; it should be a recorded one.

The relevant background is not a special-function reference — there is no series to sum here — but the general treatment of rounding to an integer lattice and the exactness of the operations involved: IEEE 754-2019's roundToIntegral* family, and Muller et al., Handbook of Floating-Point Arithmetic, on the spacing of binary64 and on rounding to a grid.

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.

ODD · 1 lines · calc-func/src/catalogue/rounding.rs on GitHub
call(ODD, "ODD", 1, NUMBER, odd)

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 recorded41
20430Windows, 64-bit, CPU not recorded1,227
  • XC-ODD-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

41 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

  • EVEN — the twin, rounding away from zero to an even integer. The pair are not inverses and do not compose usefully; they partition nothing. Note the asymmetry recorded above: EVEN's postcondition survives the 2^53 wall and ODD's does not.
  • ISEVEN / ISODD — the parity tests, which truncate toward zero. ODD is a rounding function, not a predicate, and ISODD(ODD(x)) is true by construction only below the wall.
  • MROUND — rounds to the nearest multiple. ODD is not MROUND(x, 2) with an offset: MROUND rounds to nearest while ODD rounds away, so they agree only when the argument is already past the midpoint.
  • INT and TRUNC — the other integer-valued roundings, each with a different convention. This category has floor, truncate-toward-zero, away-from-zero and half-away-from-zero all in play, and the names do not disclose which is which.
  • ROUNDUP — rounds away from zero to a number of decimal places; ROUNDUP(x, 0) is the away-from-zero integer rounding without the parity constraint.
  • The most common real use is column and row banding, and generating alternating series — both of which stay in the small-integer range where none of this page's edge cases can arise.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents