=REPLACE(old_text,start_num,num_chars,new_text)
old_text argument is used to give the cell reference of which text should be replaced. We can also give the specific text instead of cell reference.
start_num argument is used to give the location of first character in old_text argument from which replace should start
num_char argument is used to give total number of characters are to be replaced in old_text argument
new_text argument is used to give the replaced value that you want to replace in old_text
Here we have some examples, where “Column A” contains various strings and are required replace first three characters to “MON”. Output of the function returns value in ”Column B” and explanation is also provided.
We will be following REPLACE function as follows:
– old_text argument value “A2” shows the cell reference which text should be replaced
– start_num argument value “1” shows that replace of text should start from 1st character
– num_char argument value “3” shows that total 3 character to be replaced in cell “A2” string
– new_text argument value “MON” shows that first 3 characters are to be replaced with “MON”
– “MONDAY” i.e. Output in Cell “B2” is showing that characters 1 to 3 of FRIDAY (in cell “A2”) is replaced with “MON” and same to other cells.
– Spaces available in a string is counted as characters
– Value in start_num and num_chars arguments should NOT be negative
– Function should give output in “General” format, however if output is not as per the desired format then we need to change the cell format to “GENERAL”.
Here is another best rated Excel Charts and Graph Course from ExcelSirJi. This courses also includes On Demand Videos, Practice Assignments, Q&A Support from our Experts.
This Course will enable you to become Excel Data Visualization Expert as it consists many charts preparation method which you will not find over the internet.
So Enroll now to become expert in Excel Data Visualization. Click here to Enroll.
We are offering Excel VBA Course for Beginners to Experts at discounted prices. The courses includes On Demand Videos, Practice Assignments, Q&A Support from our Experts. Also after successfully completion of the certification, will share the success with Certificate of Completion
This course is going to help you to excel your skills in Excel VBA with our real time case studies.
Lets get connected and start learning now. Click here to Enroll.
Hope you are enjoying learning Excel with us, if you want any support related to this article, please do comment else you can ask questions in Excel Community
Hope you learnt this Function,
Don’t forget to leave your valuable comments!
If you liked this article and want to learn more similar tricks, please Subscribe us or follow us on Social Media by clicking below buttons:
Have you ever got into situation in office where you need to count the cells in Excel sheet with specific color? If yes then you can use following code which counts the number of cells…
COUNT function is used to get the total count of Number values in range or list.COUNT Function has one required and optional arguments.
VBA Code to Count Color Cells With Conditional Formatting Have you ever got into situation in office where you need to count the cells with specific color in conditional formatted Excel sheet? If yes then…
MID function is used for extracting the mid characters from the available string. The output of the function returns the extracted characters in new cell.
LARGE function is used to get the Largest k-th value from the range.
LARGE Function has two required arguments i.e. array, and k
Merge Cells in Excel Merge cells is to combine multiple cells into one cell which can further be used for giving title to the report or header to the column. It helps to create clean…