Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to calculate current stock or inventory in Excel
  • How to create a Histogram in Excel
  • How To Sort One Column or Multiple Columns in Excel
  • How to Create Column Chart in Excel
  • How To Compare Two Lists in Excel

References

  • INDEX function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel OFFSET function
  • How to use Excel MMULT Function
  • Find closest match in Excel
  • MATCH function: Description, Usage, Syntax, Examples and Explanation

Data Validations

  • Excel Data validation must contain specific text
  • Excel Data validation exists in list
  • Excel Data validation date in next 30 days
  • Data validation must not exist in list
  • Excel Data validation whole percentage only

REPLACE, REPLACEB functions: Description, Usage, Syntax, Examples and Explanation

by

What are REPLACE, REPLACEB functions in Excel?

REPLACE, REPLACEB functions TEXT functions in Microsoft Exce.

REPLACE replaces part of a text string, based on the number of characters you specify, with a different text string.

While REPLACEB replaces part of a text string, based on the number of bytes you specify, with a different text string.

Important:

  • These functions may not be available in all languages.
  • REPLACE is intended for use with languages that use the single-byte character set (SBCS), whereas REPLACEB is intended for use with languages that use the double-byte character set (DBCS). The default language setting on your computer affects the return value in the following way:
Worked Example:   Remove first character in a cell in Excel
  • REPLACE always counts each character, whether single-byte or double-byte, as 1, no matter what the default language setting is.
  • REPLACEB counts each double-byte character as 2 when you have enabled the editing of a language that supports DBCS and then set it as the default language. Otherwise, REPLACEB counts each character as 1.

The languages that support DBCS include Japanese, Chinese (Simplified), Chinese (Traditional), and Korean.

Syntax

REPLACE(old_text, start_num, num_chars, new_text)

REPLACEB(old_text, start_num, num_bytes, new_text)

Worked Example:   SUBSTITUTE function vs REPLACE function in Excel

The REPLACE and REPLACEB function syntax has the following arguments:

  • Old_text: Text in which you want to replace some characters.
  • Start_num:   The position of the character in old_text that you want to replace with new_text.
  • Num_chars: The number of characters in old_text that you want REPLACE to replace with new_text.
  • Num_bytes:   The number of bytes in old_text that you want REPLACEB to replace with new_text.
  • New_text : The text that will replace characters in old_text.

Example of REPLACE, REPLACEB functions

Steps to follow:

1. Open a new Excel worksheet.

2. Copy data in the following table below and paste it in cell A1

Worked Example:   Remove text by position in a cell in Excel

Note: For formulas to show results, select them, press F2 key on your keyboard and then press Enter.

You can adjust the column widths to see all the data, if need be.

Data
abcdefghijk
2009
123456
Formula Description (Result) Result
=REPLACE(A2,6,5,”*”) Replaces five characters in abcdefghijk with a single * character, starting with the sixth character (f). abcde*k
=REPLACE(A3,3,2,”10″) Replaces the last two digits (09) of 2009 with 10. 2010
=REPLACE(A4,1,3,”@”) Replaces the first three characters of 123456 with a single @ character. @456

Post navigation

Previous Post:

REPT function: Description, Usage, Syntax, Examples and Explanation

Next Post:

PROPER function: Description, Usage, Syntax, Examples and Explanation

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • IF, AND, OR and NOT Functions Examples in Excel
  • IFNA function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel NOT Function
  • IF with boolean logic in Excel
  • OR function: Description, Usage, Syntax, Examples and Explanation

Date Time

  • How to show last updated date stamp in Excel
  • Get days, months, and years between dates in Excel
  • Convert Excel time to decimal seconds
  • Add business days to date in Excel
  • Convert time to time zone in Excel

Grouping

  • How to randomly assign data to groups in Excel
  • Categorize text with keywords in Excel
  • Group numbers with VLOOKUP in Excel
  • Calculate conditional mode with criteria in Excel
  • Group arbitrary text values in Excel

General

  • Excel Ribbon Quick Overview For Beginners
  • How to calculate percentage of total in Excel
  • Currency vs Accounting Format in Excel
  • Hide and Unhide Columns or Rows in Excel
  • How to test a range for numbers in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning