+ Reply to Thread
Results 1 to 7 of 7

duplicate last 4 characters of a cell

  1. #1
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    duplicate last 4 characters of a cell

    I would like to reproduce the contents of a cell but only the last 4 characters.
    Raw Data is in column A, and contains text and numbers but I'd like to sort the data using the last 4 characters in the cell.
    Each cell in Column A has varying amounts of text and numbers, so any formula needs to look right in cell contents, and only result the last 4 characters of that cell.


    So, I'd like to look at Cell A3, then reproduce the last 4 characters in Cell A7.

    Is this possible?
    Last edited by Christopherdj; 12-21-2011 at 05:48 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: duplicate last 4 characters of a cell

    Hi,

    I think that a formula like =RIGHT(A1,4) will be what you are looking for.

    In your case above, in A3 =RIGHT(A7,4) should work.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    Re: duplicate last 4 characters of a cell

    Thanks for the solution - works fine, but has identified another problem.

    It appears my database has placed a space as the last character in some instances, and yes I could produce the last 5 characters as per your formula. But having spaces won't allow me to sort correctly.

    My solution to this is to copy the entire column, then use "paste special" selecting "values", then I use "search and replace" looking for a "space" and replace with "" nothing.
    This now allows me to sort the data.
    Last edited by Christopherdj; 12-21-2011 at 05:48 PM.

  4. #4
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: duplicate last 4 characters of a cell

    just wrap the formula in the =TRIM(function
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  5. #5
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    Re: duplicate last 4 characters of a cell

    Thanks Scottylad2 - I was totally unaware (like most advanced functions) this was possible. Anything that saves me time is very much appreciated.

  6. #6
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: duplicate last 4 characters of a cell

    THe Trim will remove a trailing or preceding space from your data, if you were referencing a text string it wouldn't interfere with spaces between word, only the ones before or after your data. Stick around this site, some verrrry smart Excellers on here who are only too happy to assist.

    You'll be hooked in no time

  7. #7
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    Re: duplicate last 4 characters of a cell

    I already am hooked. I have grown so much in knowledge in the past couple of months with excel and formulas etc. and it is all thanks to this site and in particular all those contributors to solutions. This is a fantastic resource and the ones supplying solutions should be rewarded with their weight in gold........ they are brilliant.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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