+ Reply to Thread
Results 1 to 5 of 5

Find Max Value in Range of dates defined by two user inputted dates - Ignoring year

  1. #1
    Registered User
    Join Date
    02-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    28

    Find Max Value in Range of dates defined by two user inputted dates - Ignoring year

    Hello, I am trying to extract historic temperature data between two user defined dates. This code

    =TEXT(MAX(IF(Day_Weather>=Entry_Date, IF(Day_Weather<=Exit_Date, Temp_RecH), "")), "0") & " ᵒF"

    Works just fine if the years match.

    Variable Definitions:
    Day_Weather = 365 date column range from 2014.Jan.01 - 2014.Dec.31
    Entry_Date = User defined date in the format yyyy.mmm.dd
    Exit_Date = User defined date in the format yyyy.mmm.dd
    Temp_RecH = Record high temperature value associated with the 365 date range

    If the user defined entry date and exit date are in the year 2014, the code above works just fine. However, if the dates are outside of 2014, the cell returns a #DIV/0!.

    I attempted to put a TEXT(Day_Weather, mmdd) >=TEXT(Entry_Date, mmdd) but the Day_Weather range doesn't appreciate it.

    Any suggestions?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Find Max Value in Range of dates defined by two user inputted dates - Ignoring year

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    02-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Find Max Value in Range of dates defined by two user inputted dates - Ignoring year

    Spreadsheet is attached. Thanks for the walk through too.
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Find Max Value in Range of dates defined by two user inputted dates - Ignoring year

    Looking at your data, your earliest date is 2014/Jan/02 and the latest date is 2015/Jan/01.

    Your formula works fine for any start date earlier than 2012, but if the end date is also before 2014, you have no data in that time period

  5. #5
    Registered User
    Join Date
    02-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Find Max Value in Range of dates defined by two user inputted dates - Ignoring year

    FDibbins,

    The Historic weather is valid technically through 2014.Feb.13 (The date I got it all) but the spreadsheet dates don't reflect that. However, I'm not so much concerned with how valid the data is but extracting values from it. The weather data belongs to a area that I frequently camp at and for the purpose of this spreadsheet, I'm not needing to return dates but just temperatures/times. I don't plan on updating the historic weather each year, all I want to know is with the current weather information I have, What is the Max, Min, Ave, Etc temperature between the two dates I'm going camping.

    Hopefully that explains it a little better. That's why I'm wanting to ignore the years for the data extraction.

+ 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. [SOLVED] Sort dates in ascending order ignoring the year
    By mukeshbaviskar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2014, 12:30 AM
  2. [SOLVED] Copy Columns that the headers(dates) fall within a user defined date range...
    By Zoediak in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-06-2013, 11:27 AM
  3. Find most recent date within a defined range of dates
    By xltbob in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-10-2012, 02:21 PM
  4. Replies: 5
    Last Post: 04-06-2010, 05:33 PM
  5. Replies: 3
    Last Post: 08-11-2009, 11:46 AM

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