+ Reply to Thread
Results 1 to 5 of 5

extracting a part of a number from one cell to another

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    OSLO, NORWAY
    MS-Off Ver
    Excel 2007
    Posts
    3

    extracting a part of a number from one cell to another

    I am doing a study on almost 2000 patients in OSLO, Norway. In the excel fil i received to work with Column A has the patient's birth dates registered in cells as 5 or 6 digit numbers, in a dmmyy og ddmmyy format depending if the day is above the 9th of a month or not (F.eks: 11176 would be November 1st 1976, 110176 would be January 11th 1976). I need to extract the birth month and year into columns B and C. This would take forever doing it manually and i wonder if there is a function that i can copy into each cell that will automatically extract the information out of column A.

    row nr.-----A(dmmyy/ddmmyy)-----B (Month)-------C(Year)
    --1--------------90511----------------05------------11
    --2-------------151263----------------12------------63
    --3--------------21255---------------code?---------code?
    --4-------------200220-------------copy code----copy code

    Im do know simple formulas for excel, but i dont have any idea how to do this. Does anyone have any ideas for what to put as a formula in column B and C? Help much appreciated!!
    Last edited by sverre123; 09-10-2012 at 10:02 AM. Reason: solved

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: extracting a part of a number from one cell to another

    Try:

    =--MID(A2,LEN(A2)-3,2)

    and

    =--RIGHT(A2,2)

    copied down.

    you can format numbers to show 2 digits.

    Note: You may also need to replace commas with semi colons to suit your regional settings.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,033

    Re: extracting a part of a number from one cell to another

    Month: =MID(A2;LEN(A2)-3;2)
    Year: =RIGHT(L26;2)
    Never use Merged Cells in Excel

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: extracting a part of a number from one cell to another

    Maybe

    1) =MID(A1,3,2)

    2) =RIGHT(A1,2)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Registered User
    Join Date
    09-10-2012
    Location
    OSLO, NORWAY
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: extracting a part of a number from one cell to another

    lovely! Worked like a charm! Thanks a ton!!

+ 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