+ Reply to Thread
Results 1 to 11 of 11

Looking for a rolling max count of item usage

  1. #1
    Forum Contributor
    Join Date
    09-22-2009
    Location
    Henderson, KY
    MS-Off Ver
    Excel 2007
    Posts
    152

    Looking for a rolling max count of item usage

    I have included an example of what I am hoping for.
    I am trying to get a maximum number of items used in a rolling(hope that term works) time period.
    (Meaning that Jan 1, 2013-Feb 14, 2013 would be one example of a 45 day period, Jan 2, 2013-Feb 15, 2013 would be another... etc..)
    The item period's length would be specified in 'Item List'! D1
    with the results from each sheet displayed in 'Item List'! C4:E4

    This is 1 item's usage out of a 3500 item list. I am hoping to use the result of this on all 3500 items.

    Thanks for any help you can give,
    Mike
    Attached Files Attached Files

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Looking for a rolling max count of item usage

    Hi

    Can you explain a little more pls?

    45 days starting from when?

    Can you tell us which is the expected result for your first sheet and why?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Contributor
    Join Date
    09-22-2009
    Location
    Henderson, KY
    MS-Off Ver
    Excel 2007
    Posts
    152

    Re: Looking for a rolling max count of item usage

    That is the problem. I would like to know the highest total from ALL possible 45(or whatever period length chosen) day periods. I don't want to make 1050 (365*3 - 45)separate countifs to account for each possible 45 day period in each 3 year sheet.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Looking for a rolling max count of item usage

    My question was this.

    ...Can you tell us which is the expected result for your first sheet and why?
    Is it 28 ??

  5. #5
    Forum Contributor
    Join Date
    09-22-2009
    Location
    Henderson, KY
    MS-Off Ver
    Excel 2007
    Posts
    152

    Re: Looking for a rolling max count of item usage

    largest # I can find (manual counting) is rows 35-49 with a total count of 48

    Mike

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Looking for a rolling max count of item usage

    Look Mike.

    I am the one that try to helps you and you are the one that you need help.

    So now it looks like to beg you to give me(us) more informations for helping you.

    I asked twice: Which is the expected result and why, trying to understand what do you have in your mind.

    So i wish you good luck.

  7. #7
    Forum Contributor
    Join Date
    09-22-2009
    Location
    Henderson, KY
    MS-Off Ver
    Excel 2007
    Posts
    152

    Re: Looking for a rolling max count of item usage

    I did not mean to offend.
    I thought I was giving the the answer you needed.

    I have made some changes to the 'Item List' sheet, making it give the answer from the '2007-09' sheet.
    I also did the same for the '2010-12' sheet

    My method is rather crude, and I don't see how it would work for actual sheet I am working with, that has 3500 items to count.

    Mike
    Attached Files Attached Files
    Last edited by Befuddled; 03-15-2013 at 08:22 PM.

  8. #8
    Registered User
    Join Date
    01-14-2013
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Looking for a rolling max count of item usage

    I could not figure it out , so I decided to cheat , and write a custom function.

    a couple of things you need to know.
    file must be saved as an .xlxm
    dates must be sorted smallest to largest on sheets

    copy the code below, open vba alt & F11.
    click insert then module
    paste the code into it

    the name of the function is rollingcount and is under userdefined functions.

    I attached the file that i was working with. if you click on the cell with the formula and then Fx you can see the required arguments.

    i hope this helps, and if you need anything else just let me know.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    09-22-2009
    Location
    Henderson, KY
    MS-Off Ver
    Excel 2007
    Posts
    152

    Re: Looking for a rolling max count of item usage

    I will try that.

    Thanks for helping me

    Mike

  10. #10
    Forum Contributor
    Join Date
    09-22-2009
    Location
    Henderson, KY
    MS-Off Ver
    Excel 2007
    Posts
    152

    Re: Looking for a rolling max count of item usage

    For some reason, on your attached file, the total on the "2010-2012" sheet for 45 days says 44, when it should be 116.
    I have been playing with this for a little bit, and don't understand where the total of 44 is coming from
    I changed all the entries to a QTY of 1,and then tried a 2 in every entry, and the total that the formula spits out (in cell D10) doesn't change from 44.


    Mike

  11. #11
    Registered User
    Join Date
    01-14-2013
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Looking for a rolling max count of item usage

    Quote Originally Posted by Befuddled View Post
    I changed all the entries to a QTY of 1,and then tried a 2 in every entry, and the total that the formula spits out (in cell D10) doesn't change from 44.
    I apologize the function was counting the number of times the TTMA# occurred during a time period.

    please replace the code with the one below:

    Important: Dates need to be sorted ascending, and the first date needs to be in cell "A4". If this is an issue please let me know. I can change.

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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