+ Reply to Thread
Results 1 to 12 of 12

Need help - calculating daily, weekly, and monthly totals based two dates and networkdays

Hybrid View

  1. #1
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Need help - calculating daily, weekly, and monthly totals based two dates and networkd

    It still wasnt right, 6 days was showing as 1 week 2 days.

    I think ive got it now and have amended the function to only return the item you want (either 1-Months, 2-Weeks,3-days)

    so use it as =CalcMonths(E13,1) in the Months column, (E13,2) in the weeks and (E13,3) in days.

    Function CalcMonths(inDays, outitem)
    Dim outvals(4)
    outvals(1) = 0
    outvals(2) = 0
    outvals(3) = 0
    Do Until inDays = 0
        outvals(3) = outvals(3) + 1
        Select Case outvals(3)
            Case Is = 3
                outvals(2) = outvals(2) + 1
                outvals(3) = -2
            Case Is > 5
                outvals(3) = 0
            End Select
            Select Case outvals(2)
            Case Is = 3
                outvals(1) = outvals(1) + 1
                outvals(2) = 0
                outvals(3) = -11
        End Select
        inDays = inDays - 1
    Loop
    If (outvals(3) < 0) Then
    outvals(3) = 0
    End If
    
    CalcMonths = outvals(outitem)
    End Function
    If someone has helped you then please add to their Reputation

  2. #2
    Registered User
    Join Date
    07-31-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Need help - calculating daily, weekly, and monthly totals based two dates and networkd

    I've got to run into a meeting, will give it a go later in the day.
    Thanks again, I'll let you know if I have any questions.

+ 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. summing daily weekly & monthly totals
    By jrtaylor in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-10-2014, 04:49 PM
  2. Replies: 3
    Last Post: 10-01-2013, 05:05 AM
  3. [SOLVED] How do I group daily totals into weekly/monthly/quarterly totals
    By situationroom in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-28-2013, 09:58 AM
  4. Replies: 0
    Last Post: 12-03-2012, 05:17 PM
  5. Calculate Totals weekly and Monthly from daily Figures
    By mfjanoo in forum Excel General
    Replies: 3
    Last Post: 03-05-2012, 03:06 PM
  6. Replies: 1
    Last Post: 07-11-2008, 05:57 AM
  7. Collecting weekly and monthly totals from daily data
    By Kasper in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-12-2006, 04:10 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