+ Reply to Thread
Results 1 to 3 of 3

Nested IF statements with dates

  1. #1
    Registered User
    Join Date
    02-18-2009
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Nested IF statements with dates

    This is kind of tricky:

    I need to find the # of months between two dates. Here is the criteria:

    -If the first date (start date) is on or before the 15th, that month IS included in the total
    -If the first date (start date) is on or after the 16th, that month is NOT included in the total
    -If the second date (end date) is on or before the 15th, that month is NOT included in the total
    -If the second date (end date) is on or after the 16th, that month IS included in the total

    The two dates may or may not be in the same year.

    It could be simple but I don't have time to figure it out. I would love some help!!

    Thanks!

  2. #2
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Nested IF statements with dates

    See attached.

    I'm getting lazy with my posts. I think the last three have just said "See attached".

    Please Login or Register  to view this content.
    The workbook is attached to this post with an explanation. Above is the full formula, if anyone wants to look it over and possibly make improvements.

    mew!

    EDIT:
    Alright alright, sorry...
    I'm assuming this is a sort of accounts receivable tracking system, since this is how ours works. It takes the first month at face value only if it's after the 16'th, and the second month at face value only if it's before the 16'th. Makes adjustments to the months if they fall outside those criteria. Subtracts the year values, and the resulting month values, to return the final month-difference answer.

    Note the cells must be in DATE format, since the formula sources from DAY, MONTH, and YEAR values, which will not be recogized if they're not listed as such. You didn't really state how you were planning on listing your dates, but I felt that was a safe assumption.

    mew!
    Attached Files Attached Files
    Last edited by mewingkitty; 02-18-2009 at 05:29 PM.
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested IF statements with dates

    Quote Originally Posted by mewingkitty View Post
    See attached.

    I'm getting lazy with my posts. I think the last three have just said "See attached".

    Please Login or Register  to view this content.
    The workbook is attached to this post with an explanation. Above is the full formula, if anyone wants to look it over and possibly make improvements.

    mew!
    Though it would be nice to have some explanation here so that when one opens the workbook, they can understand where to look or why it works as you designed it...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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