Results 1 to 12 of 12

Extract Date To Year With Criteria

Threaded View

  1. #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,662

    Re: Extract Date To Year With Criteria

    or... just by extending the formula that I used the first time like this:
    Formula: copy to clipboard
    =IF(ISNUMBER(A2),IF(AND(A2>=DATE(2010,7,1),A2<=DATE(2010,12,31)),2011,YEAR(A2)),IF(AND(--LEFT(A2,4)=2010,--MID(SUBSTITUTE("-"&$A2,"-",REPT(" ",125)),125*COLUMNS($A:B),125)>=7),2011,LEFT(A2,4)))

    will do it.

    It would also be possible to adapt Alkey's tidier solution, but it would depend on what digits can appear in the last group in A 1 to A3. Is 405 or 656 (ie anything where the first two digits exceed the number of days in a month) possible?
    Last edited by Glenn Kennedy; 09-14-2015 at 02:41 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Excel Extract Year from Text String Date
    By Ankit_Kumar in forum Excel General
    Replies: 2
    Last Post: 07-15-2015, 12:16 AM
  2. [SOLVED] How to extract last 2 digits from date year in next column?
    By mso3 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 12-02-2014, 12:02 PM
  3. [SOLVED] Extract Day, Month and Year from a text box (user input) date value
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-01-2014, 10:40 PM
  4. [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
  5. [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
  6. extract date info, disregard year
    By koticphreak in forum Excel General
    Replies: 2
    Last Post: 04-10-2009, 01:49 PM
  7. 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