REPLACEB

Formulas / REPLACEB
Replace text in a string using the number of bytes specified.
REPLACEB(old_text, start_num, num_chars, new_text)
  • old_text - required, the original string value
  • start - required, the position in old_text to start replacing characters
  • number_of_chars - required, the number of characters to replace in old_text_with_new_text
  • new_text - required, the replacement set of characters

Examples

  • =REPLACEB(A3,3,2,"10")

    The function replaces the last two digits of the value in cell A3 with 10. For example, if the value in cell A3 is 2009, this formula will replace the last two digits (09) with 10, resulting in the value 2010.

  • =REPLACEB(A4,1,3,"@")

    This example replaces the first three characters of the value in cell A4 with a single @ character. For example, if the value in cell A4 is 123456, this formula will replace the first three characters (123) with a single @ character, resulting in the value @456.

Summary

REPLACEB is a function used to replace text in a string with another string. It takes into account double-byte characters when editing languages that support DBCS.

  • REPLACEB is designed specifically for double-byte character sets, and will take into account the number of bytes each character uses.
  • Unlike REPLACE, REPLACEB always counts each byte used by a character rather than each character.


Frequently Asked Questions

What is the REPLACEB function?
The REPLACEB function is used with languages that use the double-byte character set. It replaces a sequence of characters in a string with another set of characters.
What is a double-byte character set?
A double-byte character set is a type of character encoding that uses two bytes per character. It is typically used for representing characters in Asian languages, and is also sometimes used for representing special characters in other languages, such as Arabic.
What languages use the double-byte character set?
The double-byte character set is typically used for representing characters in Asian languages, such as Chinese, Japanese, and Korean. It is also sometimes used for representing special characters in other languages, such as Arabic.
What does the REPLACEB function do?
The REPLACEB function replaces a sequence of characters in a string with another set of characters. For example, it can be used to replace a set of Chinese characters with their English equivalents.
What are some examples of how REPLACEB can be used?
  • It can be used to translate a string of characters from one language to another.
  • It can be used to replace certain characters with their Unicode equivalents.
  • It can be used to remove certain characters from a string.
  • It can be used to remove non-printing characters from a string.
Sourcetable Logo

Work smarter

Al is here to help. Leverage the latest models to
analyze spreadsheets, enrich data, and create reports.

Drop CSV