+ Reply to Thread
Results 1 to 3 of 3

Dates and formulas

  1. #1
    Registered User
    Join Date
    07-12-2010
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    22

    Dates and formulas

    Hey all,

    I need help with a formula.

    I have two columns of dates, beginning date and end date. I need a separate cell that will search all the end dates and compare them to the next beginning date and calculate the number of days between the two. If the number of days is 35 or greater I need that cell to populate with that number. If the number is under 35 I need the cell to be blank.

    Then, if the number is 35 or greater, I need two other cells to populate with the day after the end date and the day before the next beginning date.

    For some context - I have one sheet that lists classes that a student is taking and another that shows breaks in attendance. What I would like the second sheet to do is auto-populate from the first if the student takes any breaks 35 days or greater. The sheet should show the beginning of the break (the day after the last day of attendance) and the end (the day before the next class starts) as well as the number of days off.

    Is this even remotely possible?

    Let me know if you need some clarification.

    Thanks!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Dates and formulas

    How about this in C2 to compare the dates in A2 (begin) and B2 (end):

    =IF(B2-A2<36, "", B2-A2)

    ...then copy that cell downward. If Excel gets weird, be sure to format the column as General.
    Last edited by JBeaucaire; 09-07-2010 at 05:50 PM. Reason: Fixed....thanks Charlie
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Dates and formulas

    JB, I think you meant:
    =IF(B2-A2<36, "", B2-A2)

    hth
    CC


    If you feel really indebted please consider a donation to charity. My preferred charity is ActionAid but there are plenty of worthy alternatives.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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