+ Reply to Thread
Results 1 to 10 of 10

Count consecutive data under thresholds

  1. #1
    Registered User
    Join Date
    01-05-2015
    Location
    Denmark
    MS-Off Ver
    MS 2010
    Posts
    6

    Count consecutive data under thresholds

    Greetings.

    I'm working with a sheet for weather windows regarding offshore installation of windfarms.
    It' consist of large amount of data for 30 years windclimate; Windspeed, Waveheight and temperature.

    My current solution is too heavy for computing at this point, so I need help with a new approach to this problem.
    I need to count the consecutive hours, in which the values of wind/waves/temp do not exceed the thresholds.

    ATM, im using the approach =AND(U2<=$B$2;U3<=$B$2), creating 2 hours of values i U, being less than the threshold B2. The I just count the TRUE statements later for probability of it happening.
    For a 4 hour window i use =AND(U2<=$B$2;U3<=$B$2;U4<=$B$2;U5<=$B$2) and so on and so on.
    This results in way too much data, and I'm sure the must be an easier solution.

    The model should be able to enter a value for; Hours, max windspeed, max waveheight and max. temperature.

    I need a function that uses the hours (4), to search fx. for 4 consecutive hours of values under the threshold.

    help.PNG

    I hope you are able to help me.

    Thank you.

    I'm able to count.if, but unable to incorporate the criteria of fx. 4 consecutive hours.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Count consecutive data under thresholds

    Hi, and welcome to the forum.

    Please upload the workbook rather than a picture - see guidance in rules area.

    Be sure to manually add examples of the results you want to see.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Count consecutive data under thresholds

    can you please attach your workbook if you don't mind to understand better.
    Regards

  4. #4
    Registered User
    Join Date
    01-05-2015
    Location
    Denmark
    MS-Off Ver
    MS 2010
    Posts
    6

    Re: Count consecutive data under thresholds

    Thanks for the welcome and swift respons.

    I have attached a file, showing the idea I have used so far, and how I imagine the layout for a solution.

    B2:B5 are the thresholds, and input for the model.
    J, K and L are simple AND-functions stating if the thresholds are good or not.

    Working hours, are the number of hours in which all the statements are true.

    The problem is, I dont know how to make a function that uses the parameter "hours".
    If Hours is 6, it need to look in coloumn J, K and L for 6 consecutive hours where the values matches the threshold.

    Hope that clafiries my intended purpose.

    Thank you
    Attached Files Attached Files

  5. #5
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Count consecutive data under thresholds

    Hello
    Here come into action the array formulas
    I have made the changes
    This formula will count the specified no. of hours for which all the three values were below or equal to the threshhold.
    Hope this is what you need.
    Do ask for any other changes you want.



    If you were satisfied with my answer then please click on Add Reputation below......
    Regards
    Sourabh Gupta
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-05-2015
    Location
    Denmark
    MS-Off Ver
    MS 2010
    Posts
    6

    Re: Count consecutive data under thresholds

    Yes, this is excactly what I needed.

    Thanks for the answer, you sir deserves the reputation!

  7. #7
    Registered User
    Join Date
    01-05-2015
    Location
    Denmark
    MS-Off Ver
    MS 2010
    Posts
    6

    Re: Count consecutive data under thresholds

    I'm not quite sure i fully understand this.
    In M,N and O, when it displays the interval to look for, G2:G4, G3:G5 for 2 hours etc.
    It seems it resets when it gets to 10. Fx. G9:G2
    Is it true? Or am I doing it wrong when Im extending the formular when im trying to add more data to G,H and I.

    Thank you

  8. #8
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Count consecutive data under thresholds

    Hi
    I am Glad to know it worked
    And sorry for my that silly mistake......
    Now use this one----

    Regards
    Sourabh Gupta
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    01-05-2015
    Location
    Denmark
    MS-Off Ver
    MS 2010
    Posts
    6

    Re: Count consecutive data under thresholds

    Hi
    The update works perfectly, well done!

    Thank you

  10. #10
    Registered User
    Join Date
    01-05-2015
    Location
    Denmark
    MS-Off Ver
    MS 2010
    Posts
    6

    Re: Count consecutive data under thresholds

    Had an additional problem, but fixed it
    Last edited by marzi_buku; 01-07-2015 at 05:17 AM. Reason: Already fixed it

+ 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. Replies: 5
    Last Post: 02-05-2014, 10:19 AM
  2. How to Count the # of consecutive occurences >2 in a row of data
    By bparrott in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-29-2013, 05:03 PM
  3. How do I count the number of consecutive occurences within a data range?
    By PhDScience in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-07-2013, 11:01 PM
  4. Replies: 4
    Last Post: 01-15-2012, 12:42 PM
  5. Time above and below thresholds of cyclic data
    By crusher32 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-19-2009, 08:43 PM

Tags for this Thread

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