+ Reply to Thread
Results 1 to 9 of 9

Finding the time, the first time a number is equal or above a certain number

  1. #1
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Question Finding the time, the first time a number is equal or above a certain number

    Hi, Happy new year everybody!

    I need help with two formulas

    First formula: Should find the time (the green cell G119) the FIRST time it finds a cell in column C where the value is equal or above a certain number found in K120, and which match the DATE(22 nov) in cell K121.
    Then I would have to copy that formula to find another number, ex 2.5

    The second formula needs to find the lowest value in column D, and the time, between the two answers given by formula 1.
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Finding the time, the first time a number is equal or above a certain number

    With your sample workbook, try these

    1. Array formula in K122
    =MIN(IF($C$8:$C$374>K120,IF($G$8:$G$374>K121,$G$8:$G$374)))


    2. Array formula in K131
    =MIN(IF($C$8:$C$374>K130,$G$8:$G$374))

    3. Array formula in L139
    =MIN(IF($G$8:$G$374>L137,IF($G$8:$G$374<L138,$D$8:$D$374)))

    4. Non-array formula in L140
    =INDEX($G$8:$G$374,MATCH(1,INDEX(($D$8:$D$374=L139)*($G$8:$G$374>L137)*($G$8:$G$374<L138),0),0))


    Note: Confirm array formulas with Ctrl+Shift+Enter and not just Enter
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Finding the time, the first time a number is equal or above a certain number

    Try these user defined formulae - in the attachment

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Martin

  4. #4
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Finding the time, the first time a number is equal or above a certain number

    Quote Originally Posted by Ace_XL View Post
    With your sample workbook, try these

    1. Array formula in K122
    =MIN(IF($C$8:$C$374>K120,IF($G$8:$G$374>K121,$G$8:$G$374)))


    2. Array formula in K131
    =MIN(IF($C$8:$C$374>K130,$G$8:$G$374))

    3. Array formula in L139
    =MIN(IF($G$8:$G$374>L137,IF($G$8:$G$374<L138,$D$8:$D$374)))

    4. Non-array formula in L140
    =INDEX($G$8:$G$374,MATCH(1,INDEX(($D$8:$D$374=L139)*($G$8:$G$374>L137)*($G$8:$G$374<L138),0),0))


    Note: Confirm array formulas with Ctrl+Shift+Enter and not just Enter
    Thank you so much! They all work flawless! What should I add to the formulas to get a blank cell if the formula doesn't find a value equal or higher to the number given in K120?

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Finding the time, the first time a number is equal or above a certain number

    Just wrap the formulas in an IFERROR(formula,"")

    So..

    =IFERROR(MIN(IF($C$8:$C$374>K120,IF($G$8:$G$374>K121,$G$8:$G$374))),"")

    ..so on and so forth for the others

  6. #6
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Finding the time, the first time a number is equal or above a certain number

    Thanks, that works if there is no number in the K120, but if there is a number there, and its higher than the highest number in column C. Lets say I put 5 in K120, and the highest number in column C is 4. Then the formula gives me time: 00:00:00, instead of blank.

  7. #7
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Finding the time, the first time a number is equal or above a certain number

    Aah of course, in that case

    =IF(MIN(IF($C$8:$C$374>K120,IF($G$8:$G$374>K121,$G$8:$G$374)))=0,"",MIN(IF($C$8:$C$374>K120,IF($G$8:$G$374>K121,$G$8:$G$374)))

    Remember to array enter. Adapt for other formulas

    Alternatively, you could change settings to hide zeros
    https://support.office.com/en-us/art...5-a00e9e476b03

  8. #8
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Finding the time, the first time a number is equal or above a certain number

    Thanks! Worked perfectly!

  9. #9
    Forum Contributor
    Join Date
    07-21-2014
    Location
    Norway
    MS-Off Ver
    2016
    Posts
    230

    Re: Finding the time, the first time a number is equal or above a certain number

    Quote Originally Posted by mrice View Post
    Try these user defined formulae - in the attachment

    Please Login or Register  to view this content.
    Thanks for the suggestions, but I went for the other solution

+ 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: 10
    Last Post: 11-23-2019, 01:15 AM
  2. Replies: 10
    Last Post: 03-24-2019, 11:57 AM
  3. Finding the largest number if value in second field is equal to X
    By orangebloss in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-07-2018, 11:45 AM
  4. Replies: 10
    Last Post: 10-30-2013, 07:29 PM
  5. Replies: 3
    Last Post: 03-28-2012, 07:14 AM
  6. Finding if a variable is equal to a number set
    By finndus in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-06-2011, 05:29 PM
  7. Finding what numbers equal another number
    By all2sober in forum Excel General
    Replies: 1
    Last Post: 06-26-2008, 01:54 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