+ Reply to Thread
Results 1 to 6 of 6

Finding highest value in a week from daily data

  1. #1
    Registered User
    Join Date
    04-20-2009
    Location
    NYC, NY, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Finding highest value in a week from daily data

    I have two columns.

    A column = contains dates but does not always have 5 days in a week. Holidays are not entered.

    B column = price data for each day

    All I want to do is get the highest price from the previous week. So for example last week highest price was 5000 then column C will display 5000 for this entire week. I tried using WEEKNUM and WEEKDAY but i am clueless on what to do after that. I'm trying to avoid macros or VB since im not that advance with that. But if I have to I will.
    Last edited by borabora12; 04-20-2009 at 04:24 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Finding highest value in a week from daily data

    Can you post a sample workbook showing what you want to see? Makes it easier to visualize and get on the same page.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Finding highest value in a week from daily data

    As NBVC states a sample file is invariably helpful to iron out kinks...

    The below is based on assumption that the dates in Col A are listed in Ascending order ... say from A2 onwards and values in B2 onwards, week is deemed to be Mon-Sun

    C2: =MAX(IF(($A$2:$A2>=$A2-WEEKDAY($A2,3)-7)*($A$2:$A2<=$A2-WEEKDAY($A2,3)-1),$B$2:$B2))
    committed with CTRL + SHIFT + ENTER

    copied down as required

  4. #4
    Registered User
    Join Date
    04-20-2009
    Location
    NYC, NY, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Finding highest value in a week from daily data

    Sorry for not adding it before. As you can see Column C, I manually did what I want the formula to do, which is get the highest value from the previous week. (weekdays only, but can be either 1,2,3,4 or 5 days due to holidays)

    thanks in advance
    Attached Files Attached Files

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Finding highest value in a week from daily data

    In which case perhaps:

    C3:
    =MAX(IF(($A$3:$A$30>=$A3-WEEKDAY($A3,3)-7)*($A$3:$A$30<=$A3-WEEKDAY($A3,3)-1),$B$3:$B$30))
    committed with CTRL + SHIFT + ENTER
    change ranges to suit & copy down as required

  6. #6
    Registered User
    Join Date
    04-20-2009
    Location
    NYC, NY, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Finding highest value in a week from daily data

    thank you so much DonkeyOte!

+ 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