First, REPLACEB grammar
REPLACEB (Old_text, start_num, Num_bytes, New_text)
Old_text: Required. The text to replace some of its characters.
Start_num: Required. The position of the character in the old_text to replace with new_text.
Num_chars: Required. You want replace to replace the number of characters in old_text with New_text.
Num_bytes: Required. You want REPLACEB to replace the number of bytes in old_text with Ew_text.
New_text: Required. The text that will be used to replace the characters in old_text.
To put it simply, the Chinese syntax for this function is:
REPLACEB (original character, replace from this position, replace the length, replace with what character)
Note that the substitution of the function is, in bytes, substituted. A Chinese account of two bytes, please note that the number of bytes in Chinese is two bytes.
Two, Replaceb function use example
Let's look at the table directly.
A2 is the original character, B2 is the replacement character, we first parse the original character.
The character for the Volkswagen computer ABC, which contains the Chinese popular computer, then, a Chinese war Two bytes, so, the general computer in the Chinese language of the length is 2.
Here's a concrete example.
In the diagram above, we analyze the replacement process directly using the function =replaceb (a2,1,2, "yes") below.
Replace the A2 character, replaced by the word, replaced with a 1-bit, replacing two-length characters, just to make up two characters, just completely replaced by the word.
Then look at an example.
=REPLACEB (a2,3,3, "yes"), the replacement process of the formula is analyzed as follows:
Replace the character in the third position of the A2 with the word, replacing the total three lengths.
The third position of the character is the word, the word for two characters of the length, just be completely replaced, and the formula replaces is three lengths, the word occupies two lengths, still has one length, then, is the word, the meter word is also Chinese, occupies two byte length, but at this time only replaces one, then, can not leave half of the word, Because the characters cannot be displayed so that the count is only two characters long, it is still replaced, but a space is left. This is the byte of the way to replace characters, please be careful to understand.