+ Reply to Thread
Results 1 to 5 of 5

SUBSTITUTE AND REPLACE in the one cell

  1. #1
    Registered User
    Join Date
    08-17-2016
    Location
    Australia
    MS-Off Ver
    Office 365 Business
    Posts
    90

    SUBSTITUTE AND REPLACE in the one cell

    Probably super simple, but every combination I try fails.

    I basically have a list of phone numbers I need amended - country code removed and replaced with a 0, and all spaces removed i.e.
    I have +61 412 345 678, and I want it to read 0412345678

    I can only do this if I substitute the spaces in once cell and then replace the first three characters in the second cell, which works but I'm a nerd and want to achieve this in one cell.

    Thanks legends!

    Matt

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,701

    Re: SUBSTITUTE AND REPLACE in the one cell

    How about this?

    =TEXT(TRIM(MID(A1,FIND(" ",A1)+1,11)),"000000000")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,150

    Re: SUBSTITUTE AND REPLACE in the one cell

    Substitute ";" with "," depending on your language settings of your Excel and try this;

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: SUBSTITUTE AND REPLACE in the one cell

    If you dont want to use other cell for replacing, try to use Find and replace instead
    Highlight the range, Ctrl-H:
    step 1: Find what: +61
    Replace with: Leave it blank
    OK
    step 2: Find what: blank character (hit spacebar )
    Replace with: Leave it blank
    OK
    Quang PT

  5. #5
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,075

    Re: SUBSTITUTE AND REPLACE in the one cell

    Another option
    =TEXT(SUBSTITUTE(REPLACE(A2,1,FIND(" ",A2),"")," ",""),"0000000000")

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Substitute/Replace Then Extract
    By Sparky42PT in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-21-2020, 09:03 AM
  2. [SOLVED] How to replace or substitute function formulas but left the cell reference intact?
    By Franky alta in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 05-02-2016, 12:48 AM
  3. [SOLVED] Substitute formula - i want to replace cell containing special characters "??????*"
    By karthikskengeri in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-14-2013, 06:21 AM
  4. [SOLVED] How can I replace a word from a sentence in a cell & substitute word from another cell
    By rionoah in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-11-2012, 08:44 AM
  5. [SOLVED] substitute/replace until
    By JanRaven in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-02-2012, 12:03 PM
  6. Substitute/Replace
    By Viktor Ygdorff in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-17-2006, 07:40 AM
  7. [SOLVED] Substitute ,replace and delete in a cell.
    By Doug in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-09-2005, 11:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1