+ Reply to Thread
Results 1 to 11 of 11

Formula For Dates

  1. #1
    Registered User
    Join Date
    05-30-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    62

    Formula For Dates

    Good Day

    I please need some help,

    I am looking for a formula that will pull through a set date, if the dates chosen fall between certain dates. E.g below:

    The rules are: 1 Jan 2010 to 30 June 2010 - should pull through 30 June 2016
    1 July 2010 - 30 June 2011 - should pull through 30 June 2017
    1 July 2011 - 30 June 2012 - should pull through 30 June 2018
    And so on.

    My question is if 1 April 2010 is select as the date, what formula do I use to check if 1 April 2010 is between 1 Jan 2010 and 30 June 2010 in order to give me 30 June 2016?

    Please Help?

    The below is what I have, though does not seem to be working

    =IF(AND(E1>=DATE(2010,1,1),E1<=DATE(2010,6,30)),DATE(2010+6,6,30),IF(AND(E1>=DATE(2010,7,1),E1<=DATE(2011,6,30)),DATE(2010+7,6,30),IF(AND(E1>=DATE(2011,7,1),E1<=DATE(2012,6,30)),DATE(2010+8,6,30),IF(AND(E1>=DATE(2012,7,1),E1<=DATE(2013,6,30)),DATE(2010+9,6,30),IF(AND(E1>=DATE(2013,7,1),E1<=DATE(2014,6,30)),DATE(2010+10,6,30),IF(AND(E1>=DATE(2014,7,1),E1<=DATE(2015,6,30)),DATE(2010+11,6,30)))))))

  2. #2
    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: Formula For Dates

    Hi there. This will do what you jneed.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 08-22-2014 at 05:49 AM.
    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

  3. #3
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Thumbs up Re: Formula For Dates

    Got the solution..

    Check the attachment..
    Don't forget to click *
    Attached Files Attached Files
    Last edited by JBeaucaire; 08-29-2014 at 01:14 PM.

  4. #4
    Registered User
    Join Date
    05-30-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Formula For Dates

    Thanks for the Help, though I am getting a #N/A

  5. #5
    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: Formula For Dates

    Can you be a bit more specific? Which solution(s) have you tired? Which one is giving #N/A? What input caused this error?

  6. #6
    Registered User
    Join Date
    05-30-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Formula For Dates

    Apologies Glenn, your solution does not work.

    The lookup solution from Vikas could work, However how can it work with the lookup value being from a linked cell?
    The date is selected using a date & time picker, which is then linked to a cell.

  7. #7
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Formula For Dates

    Just change the lookup_Value argument in Lookup Function .. to the base cell of Date and time picker..

    Vikas Gautam

  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,662

    Re: Formula For Dates

    You didn't meantion the date picker before... Try this.
    Attached Files Attached Files

  9. #9
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Formula For Dates

    Hi,

    Please try the following formula in B1, considering that you have the dates in A1:

    =IF(MONTH(A1)<=6,DATE(YEAR(A1)+6,6,30),DATE(YEAR(A1)+7,6,30))

  10. #10
    Registered User
    Join Date
    05-30-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2013
    Posts
    62

    Re: Formula For Dates

    Thanks to all for the help greatly appreciated.

    Glenn, Thank You your solution works

  11. #11
    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: Formula For Dates

    You're welcome. It'd also be nice if you also clicked the Add Reputation button at the foot of the post(s) of those who helped provide the soluion you wnated.

+ 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] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-20-2014, 07:42 PM
  2. [SOLVED] Creating a formula to populate range of cells between dates based on start and end dates
    By Rainmain82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-18-2014, 07:55 AM
  3. Replies: 1
    Last Post: 06-14-2014, 02:01 AM
  4. Replies: 11
    Last Post: 05-04-2014, 08:28 PM
  5. Check dates in range either same dates or different dates by formula
    By breadwinner in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-12-2013, 07:42 AM

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