How to Use the BAHTTEXT Function in Google Sheets

Published on

The BAHTTEXT function in Google Sheets allows you to convert a given number into Thai language text, where “th” is the language code for the output.

I used the DETECTLANGUAGE function to identify the code for translating the text. However, users familiar with the Thai language can easily read the output of the BAHTTEXT function in Google Sheets without additional translation.

Since I’m not familiar with the Thai language, I used the GOOGLETRANSLATE function in Google Sheets to translate the output into English. Through this, I discovered that the formula appends the currency “Baht” for integers and “Satang” for decimals. However, I encountered some translation issues, which I will address later.

First, let’s explore how to use the BAHTTEXT function in Google Sheets.

BAHTTEXT Function in Google Sheets – Syntax, Arguments, and Examples

Syntax:

BAHTTEXT(number)

Arguments:

  • number: The number to convert. It can be a numeric value, a cell reference, an array, or an array reference.

Formula Examples

The following examples demonstrate the usage of the BAHTTEXT function in Google Sheets for different types of inputs:

Number:

=BAHTTEXT(100) // returns หนึ่งร้อยบาทถ้วน

Cell Reference:

=BAHTTEXT(A1)

Array:

To use the BAHTTEXT function with arrays, include the ArrayFormula function. Ensure that enough blank cells are available below the formula cell to display the results.

=ArrayFormula(BAHTTEXT({1;2;3;4;5;6;7;8;9;10}))

This formula converts the numbers 1 to 10 into Thai language text.

Array Reference:

Suppose you need to convert the numbers in the range B2:B11 into Thai text. You can use the following formula in cell C2 after clearing any existing content in the range C2:C11:

=ArrayFormula(BAHTTEXT(B2:B11))

Key Features

Here are some of the key features of the BAHTTEXT function in Google Sheets:

  1. It converts both integer and decimal values.
  2. It can handle negative values. To exclude the negative sign, wrap the number with the ABS function (e.g., =BAHTTEXT(ABS(B2))).
  3. A blank cell evaluates to 0 (zero) and is converted accordingly.
  4. If the number argument is text, the result will be a #VALUE! error.
  5. Numbers formatted as text are converted without issue.
  6. If the number argument contains an error value, the formula returns the same error.

Using BAHTTEXT with GOOGLETRANSLATE in Google Sheets

When I first explored this function, I considered combining it with the GOOGLETRANSLATE function to convert numbers into English text. While it works, the output isn’t always accurate. Here’s how you can try it:

Steps:

  1. Enter some numbers in the range B2:B18, as shown in the screenshot below.
  2. To convert the numbers into Thai text, use the following formula in cell C2 and drag it down:=BAHTTEXT(B2)
    Alternatively, use:=ArrayFormula(BAHTTEXT(B2:B18))
    Ensure that the range C2:C18 is empty before inserting the formula.
  3. To translate the Thai text into English, use the following formula in cell D2 and drag it down:=GOOGLETRANSLATE(C2,"th","en")
    Here, “th” and “en” represent the language codes for Thai and English, respectively.
Using BAHTTEXT and GOOGLETRANSLATE in Google Sheets

When combining BAHTTEXT with GOOGLETRANSLATE, I noticed inconsistencies in the translation. For instance, the amount 1110 initially translated from Thai text to English as “One thousand one hundred million.” However, the updated translation now correctly displays “One thousand one hundred and ten baht.”

Had the translations been consistently accurate, I planned to use REGEXREPLACE or SUBSTITUTE to replace “Baht” and “Satang” with “Dollars” and “Cents,” respectively. Given the initial inconsistencies, I decided against it.

Note: Recent observations suggest that developers may have improved the function’s accuracy. For example, 1110 now returns the Thai text “หนึ่งพันหนึ่งร้อยสิบบาทถ้วน” and translates accurately to “One thousand one hundred and ten baht.” This behavior was different earlier (please see the image above).

Conclusion

That’s how you can use the BAHTTEXT function in Google Sheets to convert numbers into Thai language text. While it’s a powerful feature, its integration with other functions like GOOGLETRANSLATE requires careful handling due to potential inconsistencies.

Thanks for reading. Enjoy!

Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

How to Extract Numbers from Text in Excel with Regex

You can use the REGEXEXTRACT or REGEXREPLACE functions to easily extract numbers from text...

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

How to Use OFFSET and XMATCH Functions Together in Excel

We often use the OFFSET and XMATCH functions together to match a value in...

How to Calculate Maximum Drawdown in Excel and Google Sheets

You can use the following dynamic array formula to calculate maximum drawdown (MDD) in...

More like this

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

Running Count with Structured References in Google Sheets

Running a count with structured references is achievable in Google Sheets tables using the...

Running Total with Structured Table References in Google Sheets

You can use two types of formulas to create a running total with structured...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.