+ Reply to Thread
Results 1 to 4 of 4

If year of a date matches the year of any date in a range of dates, return true

  1. #1
    Registered User
    Join Date
    06-16-2015
    Location
    Tampa, Florida
    MS-Off Ver
    2010
    Posts
    7

    If year of a date matches the year of any date in a range of dates, return true

    Simple as the Title states: If year of a date matches the year of any date in a range of dates, return true. The only thing is, I'm trying to find a way to write a function that doesn't require me to individually compare the first date to each date in the range. For example:

    =If(OR(YEAR(A1)=YEAR(C1),OR(YEAR(A1)=YEAR(C2),OR(YEAR(A1)=YEAR(C3),"TRUE","FALSE")

    The closest I've gotten is:

    =IF(YEAR(C1:C3)=YEAR(A1),"TRUE","FALSE")

    But that doesn't work obviously… any help is appreciated!

  2. #2
    Forum Guru Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If year of a date matches the year of any date in a range of dates, return true

    One way...

    Data Range
    A
    B
    C
    1
    9/21/2008
    ------
    6/11/2007
    2
    3/22/2010
    3
    5/23/2008
    4
    5
    TRUE


    This array formula** entered in A5:

    =OR(YEAR(C1:C3)=YEAR(A1))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: If year of a date matches the year of any date in a range of dates, return true

    Hi

    Try this (not tested)
    =IF(OR(YEAR(C1:C3)=YEAR(A1),"True","FALSE"))

  4. #4
    Forum Guru Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If year of a date matches the year of any date in a range of dates, return true

    Quote Originally Posted by José Augusto View Post
    Hi

    Try this (not tested)
    =IF(OR(YEAR(C1:C3)=YEAR(A1),"True","FALSE"))
    That needs to be array entered.

+ 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. Replies: 1
    Last Post: 04-22-2015, 08:08 AM
  2. Return True if date in cell is between a month and year in drop down comboboxes
    By Julesdude in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2014, 05:18 AM
  3. Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  4. [SOLVED] Create Fiscal Year - Lookup Date in Fiscal Month Date Range and Return EOM Date
    By gbriscoe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-25-2013, 03:29 PM
  5. [SOLVED] Count days for specific year falling within in multi-year date range
    By jslo2013 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-04-2012, 05:58 PM
  6. Replies: 3
    Last Post: 08-14-2012, 05:14 AM
  7. formula to return a year based on a date range
    By bankster in forum Excel General
    Replies: 12
    Last Post: 03-30-2012, 04:24 AM

Tags for this Thread

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