+ Reply to Thread
Results 1 to 10 of 10

converting daily data to weekly

  1. #1
    Registered User
    Join Date
    07-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    converting daily data to weekly

    this is my first time posting and i am relatively new to excel...

    i have data on a daily basis (based on business days) going back a while. for most weeks, there are 5 days (mon to fri), but in some weeks, the markets were closed on either a friday or monday so the week only consists of 4 days.

    i need to calculate the highest daily price for each week (whether that week is four days or five days). here's an example:

    Date (day of week) Price
    1/1/90(M) 96.5
    1/2/90(T) 97
    1/3/90(W) 96
    1/4/90(Th) 97.6
    1/5/90 (F) 97.2
    1/8/90(M) 98
    1/9/90 (T) 97.4
    1/10/90 (W) 97.8
    1/11/90 (Th) 96.9
    1/15/90 (M) 98.3
    .
    .
    .
    .

    So what i am looking for is a way, preferrably not VBA, to calculate the highest price of the past week. So in my example, for the week started 1/1/90, the number i should get is 97.6, and for the week started 1/8/90, i should get 98.

    This may be a stupid question, but i would greatly appreciate any help i can get. Thank you

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: converting daily data to weekly

    If you're looking to return the maximum value in a range then use the MAX function.

    If A1:A5 = the values for a date range (say week 1),

    then this formula will return the highest value in that range.

    =MAX(A1:A5)

  3. #3
    Registered User
    Join Date
    07-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: converting daily data to weekly

    i know the max function, but my problem is that i have a lot of data, and to manually go through to find the range (i.e the dates of the week) would be impossible. is there someway to automatically determine the start and end of a week, even if some weeks end on friday and some end on thursday?

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: converting daily data to weekly

    try this formula in I2 and dragged down is array entered(see how to enter array in my signature)
    n.b you need the analysis toolpak addin activated to use weeknum()
    i added a weeknum/year key in case you go across different year ,otherwise say week 23 2008 would be included in week 23 2009
    To install the Analysis ToolPak Add-In:
    1. From the Tools menu, select Add-Ins.
    2. Select the Analysis ToolPak checkbox, and then click OK
    Attached Files Attached Files
    Last edited by martindwilson; 07-21-2009 at 12:19 PM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: converting daily data to weekly

    Possibly you could also use a Pivot Table or DMAX with date criteria.
    See attached.
    Attached Files Attached Files

  6. #6
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: converting daily data to weekly

    Hi
    please take a look at this attached file
    hope it help
    Attached Files Attached Files
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  7. #7
    Registered User
    Join Date
    07-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: converting daily data to weekly

    thank you, this worked great. i appreciate it

  8. #8
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: converting daily data to weekly

    Be sure to mark your thread as solved.

    Which solution of those offered met your requirements?

  9. #9
    Registered User
    Join Date
    07-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: converting daily data to weekly

    i also have to find the min value for each week, so i tried using the same formula but with min instead of max, but i get 0 as my answer every week. any thoughts?

  10. #10
    Registered User
    Join Date
    07-16-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: converting daily data to weekly

    and sorry, it was martindwilson's reply that i used

+ 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