+ Reply to Thread
Results 1 to 6 of 6

[SOLVED]Invoiced days per month

  1. #1
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60

    [SOLVED]Invoiced days per month

    I am trying to help someone with a function and can not figure out what would be best to use. What I have is a start rent date and an end rent date. They want to break down how many days in each month the item was on rent so they have a column for each month. For example say an item was rented on 12/14/08 and returned on 1/12/09. It was rented for a total of 30days 18 days in December and 12 days in January. So I would need a function in each column that would return a 14 in the December Column and a 12 in the January Column. Any help would be greatly appreciated as there are over 350 rows and they are doing the process manually right now and taking several days. Thank you in advance.

    Also I just noticed that the date range is currently entered as a text in the format 2008-12-14 so YYYY-MM-DD. Don't know if the text will be a problem.

    Just attached an expample. In it I am trying to find a function to fill in the green cells.
    Attached Files Attached Files
    Last edited by txbullets; 03-03-2009 at 07:23 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Invoiced days per month

    Please Login or Register  to view this content.
    The formula in C2 and copied across and down is

    =MAX(0, MIN(EOMONTH(C$1, 0), $B2) - MAX(C$1, $A2) + 1)

    EOMONTH requires the Analysis ToolPak.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60

    Re: Invoiced days per month

    ok this function works but I have to go in and manually change the format of every one of my dates. they are in a text format and are set up like YYYY-MM-DD I put in a concatenate formula to with mid, right , left and then pasted values over it but that does not seem to work either. what am I doing wrong to get these into "date" format?

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

    Re: Invoiced days per month

    To change your text dates to real dates, highlight them ALL, select:

    Data > Text to Columns > Delimited > Next > Next > Column Format [x] Date > Finish

    That fixes that.

    EDIT: Use the function above provided by SHG.
    _________________
    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!)

  5. #5
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60

    Re: Invoiced days per month

    Thank you everyone for you help. I forgot about the delimite abilitity to convert to date. Thanks a bunch. i love when my boss tells me there is no easy way to do something and I prove them wrong!!!!

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Invoiced days per month

    BTW, the dates in the first row are the first of each month.

    Would you please mark the thread as Solved?

    Click the Edit button on your first post in the thread

    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes

+ 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