+ Reply to Thread
Results 1 to 9 of 9

Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

  1. #1
    Registered User
    Join Date
    12-16-2016
    Location
    Greensboro, NC
    MS-Off Ver
    Excel 2013
    Posts
    5

    Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

    Hello, this is my first post so I don't know the editique here but here goes.

    I have a dorm room with multiple students. I also have an energy bill with start and end dates. I would like to compare each move in and move out array (up to 10) to the start and end dates of the bill to determine how many day there was no one occupying the room. Basically the number of vacant days.

    I would like to do this with formulas rather than a macro.

    Thanks for any help.

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

    Re: Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

    Welcome to the forum!

    Will you please attach a sample Excel workbook?

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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
    Registered User
    Join Date
    12-16-2016
    Location
    Greensboro, NC
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

    Okay I have attached a sample of what I am working with. The cell in particular I need help with is the Vacant Days cell. On this sheet it is Z 25 to be specific but it will need to be copied to other cells since I will need this for each unit or dorm room.

    I have given two different units to show how it works. What I have works for the most part but the second unit shows no vacant days since the first tenant moved in before the bill date begins. The problem is he also moves out before the bill date begins. Also the second tenant moves in after the bill date ends so if you were to delete the first tenant's dates my formula gives me 36 vacant days because it is taking the bill start date and comparing it to the move in date. It should show 30 vacant days since that is all the days between the bill's start and end dates.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    12-16-2016
    Location
    Greensboro, NC
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

    Any ideas?

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

    Are these data values even realistic? The first room is occupied form 11/15/16 to 7/30/17 (6 months from now). However when this person moved in, the room had already been occupied for 18 months (since 8/12/15) and both people cohabitate for the next six months.

    According to the data as I am reading it, room 1 is double occupied and room two has been vacant between 10/29/17 and 12/14/16 - am I reading that correctly?

    Also the bill date is a single date (12/916) what are the significance of the dates 11/8/16 and 12/8/16? Do you bill on a "fiscal month" running from the 8th to the 7th?

    I can't interpret the data and beyond the very basic, "I want to know how many days the room is empty." I do not understand the requirement.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  6. #6
    Registered User
    Join Date
    12-16-2016
    Location
    Greensboro, NC
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

    This is a college dorm room so you can have 4 students in a room at one time. Also you may have a student leave and get replaced. Because of this we allowed for up to then entries. Since it is a dorm room and we are looking at charging the tenant based on the amount of time they were in the room during that bill date they could have moved into the room last semester. As long as they are are in the room up to or past the bill end date there should be no days of vacancy.

    For the dated the start of the billing period is 11/8/216 and the end of the billing period is 12/8/2016. Ignore column "X", it is used for something else that doesn't pertain to these calculations.

    So in summary I am looking for how many days between 11/8/216 and 12/8/2016 there was no student occupying the room.

    Hope I was clearer.


    Quote Originally Posted by dflak View Post
    Are these data values even realistic? The first room is occupied form 11/15/16 to 7/30/17 (6 months from now). However when this person moved in, the room had already been occupied for 18 months (since 8/12/15) and both people cohabitate for the next six months.

    According to the data as I am reading it, room 1 is double occupied and room two has been vacant between 10/29/17 and 12/14/16 - am I reading that correctly?

    Also the bill date is a single date (12/916) what are the significance of the dates 11/8/16 and 12/8/16? Do you bill on a "fiscal month" running from the 8th to the 7th?

    I can't interpret the data and beyond the very basic, "I want to know how many days the room is empty." I do not understand the requirement.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

    Edit Please disregard. This is not correct. Working on another solution.

    Not sure I have interpreted correctly. I tried "shadowing" the form in AB8 with this array formula.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It returns 7 days unoccupied in that date range V4 and Y4. I copied that and pasted to AB25 and returns 31. I believe those are correct.
    Last edited by FlameRetired; 12-16-2016 at 04:14 PM.
    Dave

  8. #8
    Registered User
    Join Date
    12-16-2016
    Location
    Greensboro, NC
    MS-Off Ver
    Excel 2013
    Posts
    5

    Re: Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

    Thanks but that's not quit it. DATEDIF for the bill start and end date only have 30 days. Also the formula needs to take all ten spaces into account in case dates are entered into them. For the first example or unit there are no vacant days since the second tenant moved in Aug 2015 and will move out July 2017

    I appreciate you taking a look at it though.

    Quote Originally Posted by FlameRetired View Post
    Edit Please disregard. This is not correct. Working on another solution.

    Not sure I have interpreted correctly. I tried "shadowing" the form in AB8 with this array formula.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It returns 7 days unoccupied in that date range V4 and Y4. I copied that and pasted to AB25 and returns 31. I believe those are correct.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need to Calculate vacant days btwn 2 dates given multiple move in and move out dates

    Try array entering this.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. Calculate working days between two dates for multiple tasks
    By Quasar82 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-24-2016, 02:31 PM
  2. Replies: 7
    Last Post: 12-24-2014, 05:03 PM
  3. Replies: 1
    Last Post: 12-24-2014, 03:52 PM
  4. Replies: 1
    Last Post: 11-01-2012, 03:41 PM
  5. calculating the # of days btwn 2 dates INCLUDING the dates
    By jfarlow in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-18-2008, 12:27 PM
  6. How Do I Sum Dates and Move the sum
    By wiredwrx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-18-2006, 10:34 PM
  7. Move Row based on dates
    By Bill in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-28-2005, 12:06 PM

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