+ Reply to Thread
Results 1 to 13 of 13

How to extract last 2 digits from date year in next column?

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    How to extract last 2 digits from date year in next column?

    Hi friends,
    I want to extract the last 2 digits of date year in next column. For ex. suppose the date is in column O then the output should be in column P.

    I don’t want to change the date each year but I want to change the number in column P each year. 10 to 11, 11 to 12, 12 to 13 and so on each year.

    If there is a remark in column Z ‘Left’ then no change in the number in column P.
    Thanking you,
    Attached Files Attached Files
    Sincerely,

    mso3

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to extract last 2 digits from date year in next column?

    use

    =RIGHT(YEAR(O6),2)
    or
    =TEXT(O6,"yy")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to extract last 2 digits from date year in next column?

    Hi Ace_XL,
    Thank you. The first part of my problem is solved but what about the remark in column Z 'Left'. I want to increase the output in column P yearly until there is a remark in column Z 'Left'.

    Waiting to receive a solution for increment of number until the 'Left' remark in column Z.

    Thank you.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,426

    Re: How to extract last 2 digits from date year in next column?

    Try this

    =IF(Z6="left",O6,TEXT(O6,"yy"))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: How to extract last 2 digits from date year in next column?

    Use

    =Text(O6,"yy")+(z6<>"Left")

  6. #6
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to extract last 2 digits from date year in next column?

    Hi Glenn,
    Thank you. It's working fine but I have made a little revision in the formula as follows because if there is a remark 'Left' in column Z then there is a date value in column P.

    Please Login or Register  to view this content.
    Only I want to know that will the number in column P remain unchange next year 2015?

    Thank you.

  7. #7
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to extract last 2 digits from date year in next column?

    Hi Ace_XL,
    No! It's changing the year now. It should be change next year. It's not changing the value in column P if there is a remark 'Left' in column Z which is ok.

    Suppose if there is a date in column o6: 01-05-2011 then there should be 11 in column p and next year 12 and not now.
    If there is a remark 'Left' in column Z then the number in column P should be 11.

    Thank you.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,426

    Re: How to extract last 2 digits from date year in next column?

    Confused...

    Cell P7. Now (1st December 2014) you want this to show 12/06/2011. Next year (1st January??), or on the anniversary of this event (12/06) -WHICH?? - you want the cell entry to change to 12/06/2012? is that correct? If not, please take a deep breath and explain again...

  9. #9
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to extract last 2 digits from date year in next column?

    Hi Glenn,
    Thank you for your deep concern to solve my problem.

    Please don't confuse. I have made the necessary changes manually in the attached workbook for your better understanding to achieve the target. At present the entries are in different columns but I want to change it automatically each year in column P only and not other columns as shown in the workbook. There is a another data in my original workbook.

    If it is not possible by formula then a vba solution will be accepted.

    Hope this will clear your confusion.

    Thank you.
    Attached Files Attached Files
    Last edited by mso3; 12-01-2014 at 09:22 PM. Reason: Attach a workbook

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,426

    Re: How to extract last 2 digits from date year in next column?

    There still seems to be some information missing. cell P6. Why did this not change to 12 in 2012? Why did it not change to 13 in 2013? How do you know in what year to begin increasing the number?

  11. #11
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to extract last 2 digits from date year in next column?

    Hi Glenn,
    The number in p6 is a extract of the last 2 digits in the date column ‘O’.
    If there is a 12 in the date then it changes to 12 in column P. I have a formula which converts the number into from-to year so I want this number. For example: If there is 12 in column P then it will change to 2012-2013 in column Q. If there is 11 in column P then it will change to 2011-2012 in column Q.

    I will know from which year the number is increasing by the date in column O which is static.

    Hope this will clear your doubt.

    Thanking you,
    Attached Files Attached Files

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,426

    Re: How to extract last 2 digits from date year in next column?

    I don't understand the logic behind all this... But... Try this out.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: How to extract last 2 digits from date year in next column?

    Hi Glenn,
    Thank you. Now it's working absolutely fine as per my requirement.

    Thank you very much for solving my problem.

+ 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 Year or Month only from a cell with date and time
    By djaurit in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2013, 04:03 PM
  2. [SOLVED] Extract Text from String then Convert to a Date (Month/Year)
    By sgrey24 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-14-2013, 06:11 PM
  3. Extract and manipulate Last 2 Digits form Date/Time
    By NSTurk725 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-02-2010, 03:49 PM
  4. extract date info, disregard year
    By koticphreak in forum Excel General
    Replies: 2
    Last Post: 04-10-2009, 01:49 PM
  5. extract year from the date in a cell
    By DKY in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-17-2006, 03:10 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