Google Sheets REPLACEB Function

This post will guide you how to use Google Sheets REPLACEB function with syntax and examples.

Description


The Google Sheets REPLACEB function replaces all or part of a text string with another text string based on a number of bytes.

The REPLACEB function can be used to replace characters specified by position in the given text string with another newly text string in google sheets.

The REPLACEB function is a build-in function in Google Sheets and it is categorized as a Text Function.

Syntax


The syntax of the REPLACEB function is as below:

=REPLACEB (old_text, start_num, num_bytes, new_text)

Where the REPLACEB function arguments are:

  • Old_text -This is a required argument. The text string that you want to replace all or part of
  • Start_num – This is a required argument. The position of the first character that you want to replace within old_text.
  • Num_bytes – This is a required argument. The number of characters that you want to replace within old_text
  • New_text – This is a required argument. The new text that will replace characters in old_text text string.

Note:

  • The returned results of REPLACEB function are treated as text string in google sheets and if you are using the REPLACEB function with numbers in calculations, the error message may be returned.
  • The REPLACEB function returns text as the output. And if you wish to return a number, and you can try to use the VALUE function in combination with the REPLACEB function.
  • The REPLACEB function takes 4 required arguments. The first argument, old_text, is the text string that a part of which will be replaced. The second argument, Start_num is the position where the replacement will begin to replace. The third argument, Num_bytes is the number of bytes in the text to be replaced. The last argument, New_text is the text which will be inserted into the original text string.
  • If both Start_num and Num_bytes are not a positive number and the REPLACEB function returns a #VALUE error.
  • It is designed to work with double-type characters set. Such as: simplified Chinese.
  • REPLACEB function will return the same value as REPLACE function if the old_text has only single byte characters.

Google Sheets REPLACE Function Examples


The below examples will show you how to use google sheets REPLACEB function to replace part of a text string with another new text string.

#1 To replace 4 bytes in B1 cell with a new text string and starting with 7th character in old_text text, just using formula:

=REPLACEB(B1,7,4," replace") //it returns “google replace1 sheets 2020”

google sheets replaceb function1

Note: You can use the REPLACEB function to replace a newly text string at a given position in a text string. And you can use the SUBSTITUTE function to replace an existing text with a new text in a string. And Using FIND function and SEARCH function to get the location of a given text string in a text sting.

 

Related Posts

Google Sheets VALUE Function
google sheets value function1

This post will guide you how to use Google Sheets VALUE function with syntax and examples. Description The Google Sheets VALUE function converts a text string that represents a number to a numeric value. The VALUE function can be used ...

Google Sheets T Function
google sheets t function1

This post will guide you how to use Google Sheets T function with syntax and examples. Description The Google Sheets T function returns the text referred to by value. You can use T function to remove values that are not ...

Google Sheets SUBSTITUTE Function
google sheets substitute function

This post will guide you how to use Google Sheets SUBSTITUTE function with syntax and examples. Description The Google Sheets SUBSTITUTE function replaces a new text string for an old text string in a text string. The SUBSTITUTE function can ...

Google Sheets SPLIT Function
google sheets split function

This post will guide you how to use Google Sheets SPLIT function with syntax and examples. Description The Google Sheets SPLIT function used to divide text string around a specified character or delimiter and put each separate pieces into a ...

Google Sheets SEARCHB Function
google sheets searchb function

This post will guide you how to use Google Sheets SEARCHB function with syntax and examples. Description The Google Sheets SEARCHB function returns the number of the starting location of a substring in a text string counting each double-character as ...

Google Sheets SEARCH Function
google sheets search function

This post will guide you how to use Google Sheets SEARCH function with syntax and examples. Description The Google Sheets SEARCH function returns the number of the starting location of a substring in a text string. You can use the ...

Google Sheets ROMAN Function
Goo

This post will guide you how to use Google Sheets ROMAN function with syntax and examples. Description The Google Sheets ROMAN function converts a given number to a Roman numeral as text result. The ROMAN function can be used to ...

Google Sheets RIGHTB Function
google sheets rightb function

This post will guide you how to use Google Sheets RIGHTB function with syntax and examples. Description The Google Sheets RIGHTB function returns a substring (a specified number of the bytes) from a text string, starting from the right portion. ...

Google Sheets RIGHT Function
google sheets right function

This post will guide you how to use Google Sheets RIGHT function with syntax and examples. Description The Google Sheets RIGHT function returns a substring (a specified number of the characters) from a text string, starting from the rightmost character. ...

Google Sheets REPT Function
google sheets rept function

This post will guide you how to use Google Sheets REPT function with syntax and examples. Description The Google Sheets REPT function repeats a text string a specified number of times. The REPT function can be used to repeat specified ...

Sidebar