+ Reply to Thread
Results 1 to 4 of 4

Looping by weeks...by months

  1. #1
    Registered User
    Join Date
    12-29-2010
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2003
    Posts
    14

    Looping by weeks...by months

    Hi,

    I have an attached spreadsheet, which has months (January 2011 for example) and the weeks broken out by Thursdays. (1/6/2011, 1/13/2011) Under the months I have a number, what I need to do is find a way to loop through the months, while iterating (looping) by week. Divide that monthly number by 4.25 and have it appear under the week. So 6.12 (26/4.25) would appear for every week in January. I can't iterate simply by four as you can see some months have 5 weeks. I have been at this a while but can't get VBA to quite do it. Sorry if my description is not clear, if you look at the attachment I manually did what i would like to loop through. Thanks, and let me know f you need anything else.

    Tom
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,598

    Re: Looping by weeks...by months

    I don't quite understand your worksheet. The attachment uses worksheet formulas to obtain;
    Attached Files Attached Files
    Ben Van Johnson

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Looping by weeks...by months

    Try this in G9

    =INDEX($A$9:$D$9,1,MATCH(DATE(YEAR(G6),MONTH(G6),1),$A$6:$D$6,0))/4.25

    Drag across to column W
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    12-29-2010
    Location
    Philadelphia, USA
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Looping by weeks...by months

    Hi protonLeah and Marcol,

    Thanks for the replies. Proton...i was giving an example of what I would like to make automatic. Marcol this works great can't thank you enough, I really appreciate it.

+ 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