+ Reply to Thread
Results 1 to 9 of 9

Prefixing entries in colum with word

  1. #1
    Registered User
    Join Date
    12-10-2014
    Location
    Bangor
    MS-Off Ver
    2010
    Posts
    20

    Prefixing entries in colum with word

    I have a spreadsheet containing rows of addresses including a field for County.

    The County field is blank for any address where the Post Town has same name as the County ie Armagh, Londonderry, Antrim etc.

    How can I prefix the name of the County in each cell with either "Co. " or "County " but only do it in the cells that have an entry ie leave the blank ones blank ?

  2. #2
    Registered User
    Join Date
    01-13-2015
    Location
    Leicester, England
    MS-Off Ver
    2013
    Posts
    42

    Re: Prefixing entries in colum with word

    You can use an IF with a ISBLANK.

    =IF(ISBLANK(A1),"","Co. "&A1) or
    =IF(ISBLANK(A1),"","County "&A1)

    A1 is the cell with the county in it.

    Alex

  3. #3
    Registered User
    Join Date
    12-12-2014
    Location
    PL
    MS-Off Ver
    2010
    Posts
    55

    Re: Prefixing entries in colum with word

    You can use a helper column with an IF statement (if not blank then "co." & cell value) and then copy-paste. Another way to tackle this would be vba.

  4. #4
    Registered User
    Join Date
    12-10-2014
    Location
    Bangor
    MS-Off Ver
    2010
    Posts
    20

    Re: Prefixing entries in colum with word

    That is great. If the original entries are in Column A and we put the new combined input in Column B how can I delete column A after the work is done. If it is delighted as it is then all the entries in Column B will show as Error.

    Can you lock the combined results in Columb B and then Delete Column A ?

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,763

    Re: Prefixing entries in colum with word

    I can't believe you would have the town in Column A of a list of addresses.

    Another way would be to highlight the column with the blank counties in it, then press F5 (GoTo), then click Special, then select Blanks and OK. With your cursor in the first blank cell (as it should have positioned itself) you can begin to type in the formula:

    ="Co "&

    and at that point you can click the cell next to it that you want to get the town name from. Then instead of <Enter>, you should hold down the CTRL key and then press <Enter> and then release Ctrl. You will find that all those blank cells will now be filled with the appropriate formula, so there is no change to the rest of your data.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    01-13-2015
    Location
    Leicester, England
    MS-Off Ver
    2013
    Posts
    42

    Re: Prefixing entries in colum with word

    Pete_UK's suggestion is a very good one. But if you still want to go ahead with the formulas I suggested, after you apply the formula in column B, copy the entire column B and then paste as values over it. It is safe to delete column A afterwards.To paste as values, right click, and then click Values under 'Paste Options:'.

    Alex

  7. #7
    Registered User
    Join Date
    12-10-2014
    Location
    Bangor
    MS-Off Ver
    2010
    Posts
    20

    Re: Prefixing entries in colum with word

    I was only using Column A as an example. The actual Spreadsheet has the County in Column E.

    Will try what you suggest Pete.

    Many thanks.

    Trevor

  8. #8
    Registered User
    Join Date
    12-10-2014
    Location
    Bangor
    MS-Off Ver
    2010
    Posts
    20

    Re: Prefixing entries in colum with word

    Just reading your post in more detail. I think I have not explained properly what I want.

    If the County field is BLANK I want it to stay BLANK.

    If the County field is not blank I want it to prefix whatever is in tat cell with "Co."

    So

    Antrim changes to Co. Antrim
    stays
    Down changes to Co. Down

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,763

    Re: Prefixing entries in colum with word

    You will need to use a blank column for this (let's say column M). Then in M1 you can have this formula:

    =IF(E1="","","Co. "&E1)

    Copy this down to the bottom of your data. Then you need to fix the values - select all the cells in column M, click the <copy> icon, then right-click over the selected cells and choose Paste Special from the drop-down, then click against Values and OK then press the <Esc> key. Then you can copy column M and paste it over the contents of column E, and then you can delete column M.

    Hope this helps.

    Pete

+ 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] Prefixing Worksheet Name with Pulled Data
    By mrdintx2014 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2015, 07:27 PM
  2. Formula Help matchin colum a with colum b to display colum c
    By dbe82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-08-2013, 10:11 PM
  3. [SOLVED] How to get the most, second, third, forth and fifth Frequent word in a colum.
    By Basilspanellis in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2013, 06:08 AM
  4. Prefixing Alphanumeric entries copied from another sheet
    By MickyWykes in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-25-2012, 08:52 AM
  5. Copying data in a colum without including a word
    By caps_lock in forum Excel General
    Replies: 6
    Last Post: 10-07-2009, 10:37 AM
  6. Merging 2 cells together and prefixing
    By fuzzyjon in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-12-2006, 11:27 AM
  7. Replies: 1
    Last Post: 01-30-2006, 02:15 PM

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