+ Reply to Thread
Results 1 to 10 of 10

Find number of instances data is with with a range

  1. #1
    Registered User
    Join Date
    08-31-2009
    Location
    Mbabane, Zimbabwe
    MS-Off Ver
    Excel 2010
    Posts
    29

    Find number of instances data is with with a range

    In Excel 2010, I need to analyse data. The data is time stamped, i.e column A contains data in the format dd/mm/yyyy hh:mm:ss. Column B contains values

    I want to look at the data in column B and determine:
    * how many times data exceeded a specific value.
    * the time period the data exceeded the specific value. i,e The data exceed the specific value at this time (Column A) and returned >= to the specific at at this time (Column A), therefore it was out of range for "X" time

    How would I do this?
    Last edited by TimTDP; 10-13-2011 at 10:18 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Find number of instances data is with with a range

    Ideally, if you post an example spreadsheet with dummy data and examples of what it looks like and what you want returned, this becomes much easier and you'll get more specific recommendations.

    "How many times"
    =COUNTIF(B:B, "> 0.5")
    Not sure about how your data is set up to solve the second part.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    08-31-2009
    Location
    Mbabane, Zimbabwe
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Find number of instances data is with with a range

    Thanks for the answer to part 1. This is perfect

    I have attached an example spreadsheet with dummy data
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Find number of instances data is with with a range

    Okay, here's what I came up with for your second formula. It puts it next to the first excursion rather than the last one (as per your example). Enter this into E11 dragged down.

    =IF(AND(D11>=3, D10<3),TEXT((INDEX(C11:$C$29,MATCH(3,D11:$D$29,-1)+1)-C11) * 60 * 24,"#")&" minutes","")

    Does that work for you?

  5. #5
    Registered User
    Join Date
    08-31-2009
    Location
    Mbabane, Zimbabwe
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Find number of instances data is with with a range

    Brilliant. Thank you

  6. #6
    Registered User
    Join Date
    08-31-2009
    Location
    Mbabane, Zimbabwe
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Find number of instances data is with with a range

    Hi ChemistB

    I hope you are still monitoring this post!

    I have found a minor glitch in your solution and I hope you can fix it!

    In the attached spreadsheet the answers appear correct. But change the value in cell D11 to 3 and the results are incorrect.

    Can you please have a look?

    Much appreciated
    Attached Files Attached Files

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Find number of instances data is with with a range

    The culprit is the MATCH portion. Change the 3 to a 2.99. You want it to keep searching until it finds a value greater than or equal to 2.99.

  8. #8
    Registered User
    Join Date
    08-31-2009
    Location
    Mbabane, Zimbabwe
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Find number of instances data is with with a range

    Next, and hopefully last problem!!

    If the time, Column C, goes over midnight, and data is above limit I get an error. The formulae returns a negative number

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Find number of instances data is with with a range

    Try this in F11 of your example

    =IF(AND(D11>=3, D10<3),TEXT((MOD(INDEX(C11:$C$40,MATCH(2.99,D11:$D$40,-1)+1)-C11,1)) * 60 * 24,"#")&" minutes","")

    The MOD Function, in this case, allows you to get the absolute value of the difference of the times.

  10. #10
    Registered User
    Join Date
    08-31-2009
    Location
    Mbabane, Zimbabwe
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Find number of instances data is with with a range

    Thank you very, very much

+ 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