+ Reply to Thread
Results 1 to 5 of 5

IF statement with range of dates

  1. #1
    Registered User
    Join Date
    07-12-2016
    Location
    massachusetts
    MS-Off Ver
    excel 2010
    Posts
    44

    IF statement with range of dates

    I am trying to make a calculator that involves a range of dates-- essentially, if dates in A1 fall within 11/26/2015 and 12/8/2016, the output date must be 1/1/2016. If the dates fall OUTSIDE of that date, the output date must be =A1+31. Does anyone have any suggestions?

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: IF statement with range of dates

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF statement with range of dates

    That's pretty specific and should be simple with an if and function.

    Try
    =IF(AND(A1>=DATE(2015,11,26),A1<=DATE(2016,12,8)),DATE(2016,1,1),A1+31)

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: IF statement with range of dates

    Quote Originally Posted by Jonmo1 View Post
    That's pretty specific and should be simple with an if and function.

    Try
    =IF(AND(A1>=DATE(2015,11,26),A1<=DATE(2016,12,8)),DATE(2016,1,1),A1+31)
    I'm not sure it is, hence my request for the workbook. The OP mentions "dates" (plural) in A1.

  5. #5
    Registered User
    Join Date
    07-12-2016
    Location
    massachusetts
    MS-Off Ver
    excel 2010
    Posts
    44

    Re: IF statement with range of dates

    I actually can't attach one right now, I'm at work where the data is automatically encrypted (I can't do anything about it), but essentially My current calculator is very basic. It has A1 which can be manipulated, two cells (A2, A3) that are =a1+(x amount of days), and a cell (A4) for the first of the month following 60 days (=DATE(YEAR(A1+60),MONTH(A1+60)+1,1)). What I'm effectively trying to do is manipulate cell A4 further to have this information coincide with the information in my initial question. I realize that's pretty confusing without something to look at, and I'm not entire sure that its possible given the formula that is already in that box, but any tips would be greatly appreciated.

    This related to enrollment dates, so the above cells coincide with various deadlines and A4 is the effective date. For open enrollment periods (a range of dates from November to December), the date will automatically become 1/1/2016. It's common sense information, however I need to present this to a group of new hires as a reference.

    =IF(AND(B3>=DATE(2015,11,26),B3<=DATE(2016,12,8)),DATE(2016,1,1),B3+31) works, but I was wondering if there was a way to link (nest?) this formula with "=DATE(YEAR(A1+60),MONTH(A1+60)+1,1)"
    Last edited by coryjacques; 07-12-2016 at 12:24 PM.

+ 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: 4
    Last Post: 02-17-2015, 08:15 AM
  2. [SOLVED] Need IF statement (inside of Linest Function) that will select range based on dates
    By cpkrehbiel in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-07-2014, 09:22 PM
  3. 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
  4. If statement with a range and true/false statement
    By aarleblanc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-20-2012, 06:34 PM
  5. [SOLVED] Formula help: select a range of dates within a range of dates?
    By Rerock in forum Excel General
    Replies: 5
    Last Post: 07-22-2009, 03:00 PM
  6. if statement using a range of dates?
    By strikeofdawn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2008, 05:20 PM
  7. Replies: 8
    Last Post: 12-21-2007, 12:21 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