+ Reply to Thread
Results 1 to 10 of 10

Deriving daily maximum temperature from dataset with gaps

  1. #1
    Registered User
    Join Date
    02-18-2015
    Location
    belgium
    MS-Off Ver
    Excel 2007
    Posts
    15

    Deriving daily maximum temperature from dataset with gaps

    Hi all,

    I have a dataset with hourly temperature and wind speed/direction data. I want to calculate for each day separately the daily maximum temperature and the mean wind speed/direction. I tried to derive these values by selecting every other 24 cells. However, there are multiple data gaps scattered in the dataset and I don't know how to work around that. Is there a more efficient solution to manually find every data gap and correct for it? They do not necessarily need to be filled.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Deriving daily maximum temperature from dataset with gaps

    There are no headers in your file, so which columns represent which data?

    How would you calculate the average wind speed and direction? A straight average of the values in each column?

    Pete

  3. #3
    Registered User
    Join Date
    02-18-2015
    Location
    belgium
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Deriving daily maximum temperature from dataset with gaps

    Hi Pete,

    Thanks for the answer. The first column is the date (A), then the temperature (B), wind speed (C) and wind direction (D).
    I tried the following for the maximum temperature per day: =MAX(OFFSET($B$1,(ROW()-ROW($J$1))*24,,24,)).
    This however requires the data to be complete such that every day has 24 measurements. This is however not the case, as there are multiple data gaps.

  4. #4
    Registered User
    Join Date
    02-18-2015
    Location
    belgium
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Deriving daily maximum temperature from dataset with gaps

    Quote Originally Posted by Pete_UK View Post
    There are no headers in your file, so which columns represent which data?

    How would you calculate the average wind speed and direction? A straight average of the values in each column?

    Pete
    Hi Pete,

    Thanks for the answer. The first column is the date (A), then the temperature (B), wind speed (C) and wind direction (D).
    I tried the following for the maximum temperature per day: =MAX(OFFSET($B$1,(ROW()-ROW($J$1))*24,,24,)).
    This however requires the data to be complete such that every day has 24 measurements. This is however not the case, as there are multiple data gaps.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Deriving daily maximum temperature from dataset with gaps

    Administrative Note:

    Members will tailor the solutions they offer to the version (NOT release number) of Office (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    03-01-2022
    Location
    Eire
    MS-Off Ver
    O365
    Posts
    57

    Re: Deriving daily maximum temperature from dataset with gaps

    Maybe this???



    =SUM(INDEX(B$2:B$34000,1+24*(ROWS(G$2:G2)-1)):INDEX(B$2:B$34000,24+24*(ROWS(G$2:G2)-1)))/COUNTIF(INDEX(B$2:B$34000,1+24*(ROWS(G$1:G1)-1)):INDEX(B$2:B$34000,24+24*(ROWS(G$2:G2)-1)),"<>")

    copied across and down.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-18-2015
    Location
    belgium
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Deriving daily maximum temperature from dataset with gaps

    Hi there,
    Thanks for the reply! If I, however, copy this all the way down, the date does not stop at 30/11/20 (where the actual data list stops) but at 10/11/2020...

    Attachment 782648
    Last edited by AliGW; 06-04-2022 at 11:05 AM. Reason: PLEASE don't quote unnecessarily!

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Deriving daily maximum temperature from dataset with gaps

    Selecting attachment 782648 results in the following message: "Invalid Attachment specified. If you followed a valid link, please notify the administrator".
    That said and using the file attached to ardross' post (#6):
    1. Add a helper column (E) to display only the dates using: =DATE(MID(A2,7,4),MID(A2,4,2),LEFT(A2,2))
    2. The Max Temp column is populated using**: =MAX(IF(E$2:E$33835=G2,B$2:B$33835))
    3. The average wind speed and wind direction columns are populated using**: =AVERAGE(IF($E$2:$E$33835=$G2,C$2:C$33835))
    ** Denotes array entered formulas which are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  9. #9
    Registered User
    Join Date
    02-18-2015
    Location
    belgium
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Deriving daily maximum temperature from dataset with gaps

    Quote Originally Posted by JeteMc View Post
    Selecting attachment 782648 results in the following message: "Invalid Attachment specified. If you followed a valid link, please notify the administrator".
    That said and using the file attached to ardross' post (#6):
    1. Add a helper column (E) to display only the dates using: =DATE(MID(A2,7,4),MID(A2,4,2),LEFT(A2,2))
    2. The Max Temp column is populated using**: =MAX(IF(E$2:E$33835=G2,B$2:B$33835))
    3. The average wind speed and wind direction columns are populated using**: =AVERAGE(IF($E$2:$E$33835=$G2,C$2:C$33835))
    ** Denotes array entered formulas which are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Let us know if you have any questions.
    Thank you! This really helped alot.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Deriving daily maximum temperature from dataset with gaps

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu above your first post. I hope that you have a blessed day.

+ 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] Formula to identify if a dataset contains gaps
    By The_Snook in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-19-2021, 07:36 AM
  2. Daily Average Temperature and Precipitations from OpenWeather to Excel
    By PaulM100 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 07-15-2019, 09:45 AM
  3. Replies: 1
    Last Post: 09-02-2018, 11:45 PM
  4. [SOLVED] How to automate getting information from the web, e.g., temperature, daily ?
    By teacher_rob in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2012, 10:05 PM
  5. Replies: 7
    Last Post: 07-13-2012, 08:00 AM
  6. graphing daily dataset with weekly dataset
    By [email protected] in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-27-2009, 09:39 AM
  7. Replies: 1
    Last Post: 11-06-2008, 04:38 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