Text functions

UPPER

Matches all 10 recorded answers

Recorded: 5 in the answer bank and 5 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicUPPER
BulgarianUPPER
CzechUPPER
DanishUPPER
GermanUPPER
GreekUPPER
English (Australia)UPPER
English (United Kingdom)UPPER
English (United States)UPPER
SpanishUPPER
EstonianUPPER
FinnishISOT
FrenchUPPER
HebrewUPPER
CroatianUPPER
HungarianUPPER
IndonesianUPPER
ItalianUPPER
JapaneseUPPER
KoreanUPPER
LithuanianUPPER
LatvianUPPER
NorwegianUPPER
DutchUPPER
PolishUPPER
Portuguese (Brazil)UPPER
Portuguese (Portugal)UPPER
RomanianUPPER
RussianUPPER
SlovakUPPER
SlovenianUPPER
Serbian (Latin)UPPER
SwedishUPPER
ThaiUPPER
TurkishBÜYÜKHARF
UkrainianUPPER
VietnameseUPPER
Chinese (Simplified)UPPER
Chinese (Hong Kong)UPPER
Chinese (Traditional)UPPER

Names from Microsoft's support site.

What it does

UPPER(text)

UPPER returns the argument text with every character replaced by its uppercase form.

That sentence is short, and every hard question about the function hides inside "its uppercase form". Case mapping is not a property of a character in isolation; it is a function of a character, a mapping table, and — in the general case — a locale and the surrounding context. The four mappings a text function might implement are genuinely different:

  1. ASCII only. a–z map to A–Z; everything else is left alone. Simple, locale-free, and wrong for most of the world.
  2. Simple Unicode uppercase. One code point maps to one code point, using Unicode's simple uppercase mapping. é becomes É.
  3. Full Unicode uppercase. One code point may map to several. The canonical example is ß, whose full uppercase mapping is SS — a mapping that changes the length of the string.
  4. Locale-tailored uppercase. Turkish and Azerbaijani map dotless ı to I and dotted i to İ, which differs from every other locale's mapping of i.

These four disagree on real, ordinary text, and the difference is observable in a spreadsheet. UPPER is therefore one of the functions where "it just uppercases" is not a specification. Which of the four Excel implements, this Handbook has not established. That is the honest state and it is why the "What has not been checked" section below is unusually specific.

Arguments

UPPER(text)

ArgumentRequiredMeaning
textyesThe text to convert.

One argument, no options — in particular no locale argument, which is the reason locale-tailored mapping is such a live question: if Excel does tailor, it must be doing so from ambient state, and ambient state is exactly what makes a formula's result depend on the machine it runs on.

Non-text arguments convert to text first. Upstream records the specific rule that LOWER and UPPER textify logicals on the ordinary values-only seam, so UPPER(TRUE) is the string TRUE rather than an error or a number. Numbers arrive as their general-format rendering; since digits and the exponent marker have no distinct cases, UPPER of a number is generally that rendering unchanged, though the marker's case in scientific notation is worth checking rather than assuming.

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

The return kind is Text. UPPER("") is "".

Boundaries worth naming:

  • Length can change. If Excel implements full Unicode uppercase, UPPER can return a longer string than it was given — the ß → SS case. A caller that assumes LEN(UPPER(x)) = LEN(x) is making an assumption about which of the four mappings Excel uses.
  • The 32,767-code-unit cap therefore becomes reachable from below; see the value universe for how the cap behaves on the formula path.
  • UPPER is not a normaliser. It does not compose or decompose combining marks. UPPER of a decomposed e + combining acute is not guaranteed to equal UPPER of the precomposed é, and EXACT will tell you they differ.
  • UPPER is not injective, so it is not safely reversible: LOWER(UPPER(x)) is not x in general.
  • An empty referenced cell delivers Empty, distinct from an omitted argument.
  • Errors propagate.

Errors

Microsoft's page is the authority and is linked below; it was not retrievable while this entry was written, so nothing here paraphrases it. UPPER is a total function over text and there is no documented domain restriction to state. The reachable errors are the ordinary ones:

ErrorCondition
any error valuePropagated from the argument; coercion does not discard worksheet errors.
#VALUE!An argument kind with no text conversion in this context, or a result that exceeds the text cap on the formula path.

The second row's cap behaviour is described in the value universe as an observed distinction between the formula and interop paths; whether UPPER in particular reaches it has not been probed.

How to implement

Notes for implementers

  • Name your mapping. Write down which of the four mappings you implement and treat it as part of the signature. A port that silently uses the host language's default (to_uppercase in Rust is full Unicode; ToUpper in .NET is culture-sensitive; str.upper in Python is full Unicode) will inherit that language's choice as Excel semantics.
  • Culture-sensitive APIs are a trap in both directions. ToUpper() on a Turkish thread gives a different answer than on an invariant one. If you want reproducibility, use the invariant form explicitly — and record that you did, because it may be a divergence from Excel rather than a fix.
  • Allow the length to change in your buffers and in your result-cap check. In-place uppercase over a fixed-size UTF-16 buffer is only correct for simple mapping.
  • Operate on scalars, not code units. Case mapping of a surrogate pair requires decoding it first; a code-unit loop leaves supplementary-plane letters (Deseret, Adlam, Warang Citi) unmapped.
  • Lift a single array-valued argument.

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.

UPPER · 1 lines · calc-func/src/catalogue/text_functions.rs on GitHub
13 upper_fn "UPPER" (1, 1) [V "text"] |s, a, sv| { cased(s, a, k::upper) }

Kernels shared with other functions

Argument and result plumbing

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

Version differences

No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.

Alternatives

Relationships

  • LOWER — the mirror function, same implementation module upstream, and subject to every question on this page in the opposite direction. Note that lowercase has its own asymmetries: Greek final sigma is context-dependent in a way no uppercase mapping is.
  • PROPER — the third member of the case family. Upstream records its word-boundary behaviour as restarting capitalisation at non-letter separators including apostrophes and digits, which is why PROPER("o'brien") is not what a reader expects. PROPER is not UPPER of the first letter.
  • EXACT — the case-sensitive comparison. EXACT(UPPER(a), UPPER(b)) is the usual hand-rolled case-insensitive comparison, and it inherits every mapping question above.
  • = (the comparison operator) is already case-insensitive for text, which makes UPPER unnecessary in many comparisons where people reach for it out of habit from other languages.
  • SEARCH versus FIND, and the match_mode arguments of TEXTAFTER, TEXTBEFORE and TEXTSPLIT, express case-insensitivity directly and are usually better than uppercasing both sides.
  • ASC and DBCS are the width conversions, sometimes mistaken for case conversions because they also "change letters". They do not touch case.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents