Text functions

BAHTTEXT

Matches all 2,595 recorded answers

Recorded: 2,592 in the answer bank and 3 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicBAHTTEXT
BulgarianBAHTTEXT
CzechBAHTTEXT
DanishBAHTTEKST
GermanBAHTTEXT
GreekBAHTTEXT
English (Australia)BAHTTEXT
English (United Kingdom)BAHTTEXT
English (United States)BAHTTEXT
SpanishTEXTOBAHT
EstonianBAHTTEXT
FinnishBAHTTEKSTI
FrenchBAHTTEXT
HebrewBAHTTEXT
CroatianBAHTTEXT
HungarianBAHTSZÖVEG
IndonesianBAHTTEXT
ItalianBAHTTEXT
JapaneseBAHTTEXT
KoreanBAHTTEXT
LithuanianBAHTTEXT
LatvianBAHTTEXT
NorwegianBAHTTEXT
DutchBAHTTEXT
PolishBAT.TEKST
Portuguese (Brazil)BAHTTEXT
Portuguese (Portugal)TEXTO.BAHT
RomanianBAHTTEXT
RussianБАТТЕКСТ
SlovakBAHTTEXT
SlovenianBAHTTEXT
Serbian (Latin)BAHTTEXT
SwedishBAHTTEXT
ThaiBAHTTEXT
TurkishBAHTMETİN işlevi
UkrainianBAHTTEXT
VietnameseBAHTTEXT
Chinese (Simplified)BAHTTEXT
Chinese (Hong Kong)BAHTTEXT
Chinese (Traditional)BAHTTEXT

Names from Microsoft's support site.

What it does

BAHTTEXT(number)

BAHTTEXT spells a number out in Thai words as an amount of currency, appending the Thai word for baht — and, when there is a fractional part, the satang.

It is worth being clear about how unusual this is. BAHTTEXT is the only function in the ordinary worksheet surface that performs number-to-words conversion in a natural language. There is no ENGLISHTEXT; the equivalent in every other language is a user-defined function or a long nested formula. Its presence in the catalogue is a historical artefact of Excel's Thai localisation, and it is available regardless of the installation's language — the output is always Thai script.

The computation has three stages:

  1. Spell the integer part using Thai numeral words, then append the word for baht. Thai numeral spelling has its own irregularities — notably the special forms used for "one" in the units place and for "twenty" — which is what makes this a table-and-rules problem rather than a digit substitution.
  2. Spell the fractional part in satang and append the satang word; when the fraction is zero, append instead the Thai word meaning "exactly" or "whole" (ถ้วน), which is the conventional way to close a written currency amount and to prevent a figure being altered after the fact.

That last convention is why the zero case and the non-zero case produce structurally different strings rather than one with an empty tail.

Arguments

BAHTTEXT(number)

ArgumentRequiredMeaning
numberyesThe number to convert to Thai baht text.

One argument. It is a number, so text that reads as a number converts and TRUE converts to 1 under the general to-number rule in coercion and lifting.

There is no argument controlling the script, the currency word, or whether the trailing "exactly" appears. There is no way to get the words without the currency.

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, in Thai script.

  • Negative numbers. Upstream's contract records the current baseline as rejecting negative magnitudes with #NUM!. Excel does not reject them: it spells a negative amount with the word for minus, ลบ, so BAHTTEXT(-0.005) is ลบหนึ่งสตางค์ (FN-BAHTTEXT-001).
  • Very large magnitudes are likewise recorded upstream as rejected with #NUM!. Where the boundary sits — and whether it is a magnitude limit, a digit-count limit, or the point at which a double stops representing integers exactly — is not established here.
  • Rounding is observable at the boundary. A value ending in exactly half a satang (1.005, 2.675) will expose the rounding rule, and will also expose the fact that such values are not exactly representable as doubles in the first place. This is the one place where BAHTTEXT has a genuine floating-point subtlety, and it is inherited from the argument, not created by the function.
  • Zero produces the zero-baht form with the "exactly" tail.
  • Errors propagate; an empty referenced cell delivers Empty, distinct from an omitted argument (see the value universe).
  • Array arguments. Whether BAHTTEXT lifts elementwise is not asserted here; the general rules are in coercion and lifting.

Errors

Microsoft's page is the authority and is linked below; it was not retrievable while this entry was written, so this section states expectations and upstream readings rather than quoting it.

A tiny negative amount keeps the word for minus before zero baht

A negative amount that rounds to zero satang still gets the word for minus, ลบ: BAHTTEXT(-0.001) is ลบศูนย์บาทถ้วน. -0 gives plain ศูนย์บาทถ้วน.

FormulaExcelMathematical value
BAHTTEXT(-0.001)
Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H
Inputs and reference value

Number supplied through a cell.

number: -0.001
0xbf50624dd2f1a9fc

ลบศูนย์บาทถ้วน—
BAHTTEXT(-0)
Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H
Inputs and reference value

Number supplied through a cell.

number: -0
0x8000000000000000

ศูนย์บาทถ้วน—
BAHTTEXT(-0.005)
Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H
Inputs and reference value

Number supplied through a cell.

number: -0.005
0xbf747ae147ae147b

ลบหนึ่งสตางค์—

Inputs, build details and evidence

How to implement

Notes for implementers

  • The spelling rules are the specification. Thai numeral spelling is not digit-by-digit: the unit-place "one" has a distinct form, "twenty" has a distinct form for the tens digit, and the grouping above a million repeats a scale word rather than introducing new ones. Get these from a Thai orthography reference, not from a transliteration table.
  • Fix the rounding rule and record it. Rounding to two decimals is the only arithmetic in the function and it is where any divergence will live. Do the rounding on the decimal value the user sees, and be explicit about half-way cases.
  • The trailing "exactly" is conditional on the satang being zero after rounding, not before. BAHTTEXT(1.001) and BAHTTEXT(1) should agree if rounding takes the first to one baht exactly.
  • Emit the Thai script directly as Unicode, not through a legacy Thai code page. The result is worksheet text, which is UTF-16.
  • Validate the domain before spelling, so that an oversized input produces #NUM! rather than a partially built string. A negative input is spelled, not rejected (FN-BAHTTEXT-001).
  • Do not localise the output. It is Thai on every installation; making it follow the UI language would be a divergence, not an improvement.

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.

BAHTTEXT · 1 lines · calc-func/src/catalogue/text_format.rs on GitHub
8 bahttext_fn "BAHTTEXT" (1, 1) [V "number"] |s, a, sv| { bahttext(s, a) }
thai_number · 26 lines · calc-func/src/catalogue/text_format.rs on GitHub
/// A whole number (decimal digits, no leading zero) in Thai words: groups of six digits joined by
/// the word for a million; a one in the units after any other digit is "et", a two in the tens is
/// "yi", and a one in the tens is the tens word alone.
fn thai_number(digits: &str) -> String {
    let bytes = digits.as_bytes();
    let mut out = String::new();
    let length = bytes.len();
    for (at, &byte) in bytes.iter().enumerate() {
        let digit = usize::from(byte - b'0');
        let from_right = length - 1 - at;
        let place = from_right % 6;
        if digit != 0 {
            match place {
                0 if digit == 1 && at > 0 => out.push_str(THAI_ET),
                1 if digit == 1 => {}
                1 if digit == 2 => out.push_str(THAI_YI),
                _ => out.push_str(THAI_DIGITS[digit]),
            }
            out.push_str(THAI_PLACES[place]);
        }
        if place == 0 && from_right > 0 {
            out.push_str(THAI_MILLION);
        }
    }
    out
}
bahttext · 28 lines · calc-func/src/catalogue/text_format.rs on GitHub
/// BAHTTEXT: the number rounded to satang (two places, from its 15-digit reading, a half away
/// from zero) in Thai words. Retained BAHTTEXT readings keep the original negative sign
/// even when rounding leaves zero baht and zero satang; signed zero itself has no minus word.
fn bahttext(site: &Site<'_>, a: &[CalcValue]) -> Step<CalcValue> {
    let n = num(site, a, 0)?;
    let (whole, fraction) = format::digits(n, 2);
    let satang = fraction.trim_start_matches('0');
    let negative = n < 0.0;
    let mut out = String::new();
    if negative {
        out.push_str(THAI_MINUS);
    }
    if !whole.is_empty() {
        out.push_str(&thai_number(&whole));
        out.push_str(THAI_BAHT);
    }
    if satang.is_empty() {
        if whole.is_empty() {
            out.push_str(THAI_DIGITS[0]);
            out.push_str(THAI_BAHT);
        }
        out.push_str(THAI_EXACT);
    } else {
        out.push_str(&thai_number(satang));
        out.push_str(THAI_SATANG);
    }
    Ok(crate::catalogue::kit::text_value(&out))
}

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
20430Windows, 64-bit, AMD Ryzen 7 4800H with Radeon Graphics1,983

The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.

Recorded environments and comparison details.

Excel 16.0 build 20430

Windows 64-bit, AMD Ryzen 7 4800H

BAHTTEXT(-0.001) returned ลบศูนย์บาทถ้วน. BAHTTEXT(-0) returned ศูนย์บาทถ้วน. 1 further recorded control is attached. Inputs were supplied through cells using Value2. These are controls from this environment, not a same-input comparison with another build.

Observed formulas and results
  • BAHTTEXT(-0.001) → ลบศูนย์บาทถ้วน (cell-value2)
  • BAHTTEXT(-0) → ศูนย์บาทถ้วน (cell-value2)
  • BAHTTEXT(-0.005) → ลบหนึ่งสตางค์ (cell-value2)

Excel 16.0 build 20430

Windows, 64-bit, AMD Ryzen 7 4800H with Radeon Graphics

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

Alternatives

Relationships

  • TEXT — the general number-formatting function, and the usual alternative when what you actually wanted was a formatted numeral rather than words. TEXT cannot spell numbers out in any language.
  • DOLLAR and FIXED — the other currency-adjacent text functions. Both format digits; neither spells. DOLLAR is locale-sensitive in its symbol, which is a different kind of localisation from BAHTTEXT's fixed Thai output.
  • Readers sometimes expect BAHTTEXT to respect the workbook's currency locale. It does not; the output is Thai regardless of where the workbook is opened.
  • Nothing supersedes BAHTTEXT and it supersedes nothing.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents