+ Reply to Thread
Results 1 to 11 of 11

Find if Value is Between any of Timeframes

  1. #1
    Registered User
    Join Date
    05-02-2016
    Location
    India
    MS-Off Ver
    office 365
    Posts
    12

    Find if Value is Between any of Timeframes

    Hello,

    I want to filter all the Times which don't fall inside any of Timeframes Listed.

    Sumproduct Works but Don't Spill.

    Filter Function works but only for Single Timeframe.

    What about Multiple Timeframes?

    I have attached file herewith.

    Any help is appreciated.

    Thank You
    Attached Files Attached Files
    Last edited by pjvyas; 10-25-2022 at 01:42 PM. Reason: Attachment

  2. #2
    Registered User
    Join Date
    06-17-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    42

    Post Re: Find if Value is Between any of Timeframes

    Please try =IF(E2<=$B$2,E2,IF(AND(E2>$B$2,E2<$C$2),"",IF(AND(E2>$B$3,E2<$C$3),"",IF(AND(E2>$B$4,E2<$C$4),"",E2)))) and copy down.
    Last edited by thepdaoson; 10-27-2022 at 07:30 AM.

  3. #3
    Registered User
    Join Date
    06-17-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Find if Value is Between any of Timeframes

    Please try =IF(E2<=$B$2,E2,IF(AND(E2>$B$2,E2<$C$2),"",IF(AND(E2>$B$3,E2<$C$3),"",IF(AND(E2>$B$4,E2<$C$4),"",E2)))) and copy down.

  4. #4
    Registered User
    Join Date
    06-17-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Find if Value is Between any of Timeframes

    Please try =IF(E2<=$B$2,E2,IF(AND(E2>$B$2,E2<$C$2),"",IF(AND(E2>$B$3,E2<$C$3),"",IF(AND(E2>$B$4,E2<$C$4),"",E2)))) and copy down.

  5. #5
    Registered User
    Join Date
    06-17-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Find if Value is Between any of Timeframes

    =if(e2<=$b$2,e2,if(and(e2>$b$2,e2<$c$2),"",if(and(e2>$b$3,e2<$c$3),"",if(and(e2>$b$4,e2<$c$4),"",e2))))

  6. #6
    Registered User
    Join Date
    06-17-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Find if Value is Between any of Timeframes

    =if(e2<=$b$2,e2,if(and(e2>$b$2,e2<$c$2),"",if(and(e2>$b$3,e2<$c$3),"",if(and(e2>$b$4,e2<$c$4),"",e2))))
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-17-2011
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: Find if Value is Between any of Timeframes

    =if(e2<=$b$2,e2,if(and(e2>$b$2,e2<$c$2),"",if(and(e2>$b$3,e2<$c$3),"",if(and(e2>$b$4,e2<$c$4),"",e2))))

  8. #8
    Registered User
    Join Date
    05-02-2016
    Location
    India
    MS-Off Ver
    office 365
    Posts
    12

    Re: Find if Value is Between any of Timeframes

    Hello,

    Thank you for your help, but

    This is example data so it contains Less rows. What is there are tens of Frames?

    Is there something like CSE Formula or Recursive Lambda function?

    I want formula in which I can refer to Range and that can Spill just like it does in Filter Fuction.

    Thank You

  9. #9
    Registered User
    Join Date
    10-28-2022
    Location
    London
    MS-Off Ver
    2010
    Posts
    1

    Re: Find if Value is Between any of Timeframes

    It may fit you. G2=IF(SUMPRODUCT(($B$2:$B$34<E2)*($C$2:$C$34>E2))=0,E2,"") and copy down.

  10. #10
    Registered User
    Join Date
    05-02-2016
    Location
    India
    MS-Off Ver
    office 365
    Posts
    12

    Re: Find if Value is Between any of Timeframes

    Hello,

    Thanks for your reply.

    Yes, I tried this earlier. That works. One more formula I tried is as below.

    I name the range "Vals."

    =FILTER(Vals,(Vals<B2)+(Vals>C2))

    So it spills well.

    I tried another way also like this.
    =FILTER(Vals,(Vals>B2)*(Vals<C2))

    This lists only values that lie in between frames.

    But as soon as we refer to the range instead, that shows #N/A.

    =FILTER(Vals,(Vals>B2:B4)*(Vals<C2:C4))

    Is there a workaround which helps to spill?

    Thanks.

  11. #11
    Registered User
    Join Date
    06-16-2022
    Location
    New Jersey
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Find if Value is Between any of Timeframes

    It seems like prior responders gave you an answer which worked, but wasn't quite what you were looking for. Sounds like you wanted the answers in a shortened summary to avoid
    having a large list that was the same size as the data sample (since the size of the results of exclusivity is significantly smaller than the data size). You refer to "spill"
    which is a way that excel can provide multiple results that "spill" over the formula cell automatically. I hope I have correctly summarized your remaining goal.

    I was not able to find a formula that could be entered in a single cell and spill for values that did not exist in the list. However, I was able to produce something equivalent for items
    from the list which ARE within the ranges specified as follows:

    =IFERROR(SMALL(IF(($E$2:$E$34>TRANSPOSE($B$2:$B$4))*($E$2:$E$34<TRANSPOSE($C$2:$C$4)),$E$2:$E$34),ROW(A1)),"")
    Then you can copy down this formula until it returns "", then you have all of the values that fit within the ranges specified in a "spill" format.
    The reverse is much trickier, and, while it may be possible, to me it's not worth the extra effort when a helper column would do the trick in seconds.

    HTH,
    Dave

+ 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] Help with referencing timeframes in other worksheets
    By nated2008 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-23-2022, 03:24 AM
  2. Keep history of several exchanges in 5 timeframes
    By eafonso88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2022, 05:17 PM
  3. Replies: 1
    Last Post: 02-04-2022, 06:49 AM
  4. [SOLVED] corellation with multiple timeframes
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-25-2017, 12:20 PM
  5. Help with conditional formatting based on 6 and 12 month validity timeframes
    By Lionmann2017 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-02-2017, 03:43 AM
  6. Replies: 0
    Last Post: 09-10-2015, 08:25 AM
  7. splitting out timeframes
    By soph in forum Excel General
    Replies: 1
    Last Post: 09-20-2005, 05:05 AM

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