+ Reply to Thread
Results 1 to 4 of 4

Replace the word "City" within a sentence with the list of city names in new cell

  1. #1
    Registered User
    Join Date
    02-07-2016
    Location
    Sydney
    MS-Off Ver
    2009
    Posts
    1

    Replace the word "City" within a sentence with the list of city names in new cell

    I want to change the word "City" so that it equals the cell next to it. I.e.

    A1 A2 A3
    I love to drive in "City" "Sydney" What is the formula I need to use to Change the word "city" to equal A2?
    I love to drive in "City" "Melbourne" Eg: I love to drive in "Melbourne"
    I love to drive in "City" "New York"
    I love to drive in "City" "London"
    I love to drive in "City" "Milan"
    I love to drive in "City" "Los Angeles"

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Replace the word "City" within a sentence with the list of city names in new cell

    Hi, welcome to the forum

    If you already have date in the cell, you cannot then add a formula to it, without losing that data.

    Your copy/paste in your post did not come out that clear, and Im not sure I fully understand what you have and what you want

    Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Replace the word "City" within a sentence with the list of city names in new cell

    Not sure if I understand correctly but try this in A3 to change the word city with the word you have in A2

    =substitute(A1,"City",A2)
    Happy with my advice? Click on the * reputation button below

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Replace the word "City" within a sentence with the list of city names in new cell

    maybe:
    A1: =IF(A2="","I love to drive in ""City""","I love to drive "&A2) and drag to the right as far as you need
    A2 (B2, C2...): blank or name of city, e.g. Sydney, Paris, etc.

+ 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. [SOLVED] Extract city and state by using "/" divider
    By zeroist in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2014, 10:05 AM
  2. Calculating Shipment Rates Base on Origin City and Destination City
    By Chnatko in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-09-2014, 11:11 AM
  3. Find Names from a List of Names and Replace with "The Candidate"
    By viggykuppu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2014, 02:49 AM
  4. [SOLVED] Removing ".", "?" or "!" from last word of sentence and replacing it later in vba.
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2013, 07:20 AM
  5. Calculating City to City -road miles
    By williesmith2008 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-22-2012, 05:19 AM
  6. extract city using city list lookup
    By terrysoper1973 in forum Excel General
    Replies: 1
    Last Post: 09-07-2011, 01:43 PM
  7. Not changing from "City" to "1-City"
    By Steved in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-05-2005, 02:10 PM

Tags for this Thread

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