Forum Discussion

jazzyelsie's avatar
jazzyelsie
Copper Contributor
Feb 21, 2023

HELP! Need help filtering or finding xlookup or anyother method of finding specific data ranges

If I have a big dataset and I used conditional formatting to highlight any values from E33:E22354 <10 (including blanks) in yellow, is there a way I could use xlookup or a filter function to find the exact start and stop date/time range for those values? For example, I attached an image showing the highlighted conditional formatting. E33 is where the first highlighted value is, so the start time and date I would need to pull is data from A33 and B33: 2023/01/2 10:28:00. The stop date/time would be E37 because it stops at E36 and I want to include this value and show the full range so the stop date/time I need is from cells A&B37: 2023/01/2 10:36:00. 

 

It becomes tricky because I also need the blank values also known as a GAP, so in this example the start time for where the blanks are is the same as the stop time for A&B37: 2023/01/2 10:36:00 and the stop date/time are cells A&B38: 2023/01/2 10:38:00. The next range would be a GAP in row 39 with a start date/time of 2023/01/2 10:40:00 and end time of 2023/01/2 10:42:00. This continues inconsistently throughout E33:E22354. I only clipped part of the data for example purposes. 

 

The only caveat is I would maybe need to add "+1" for the stop time/date because for the stop time, it's the cell after and not all are highlighted. 

 

Any advice or other solutions would be appreciated. It doesn't have to be xlookup or filter, but I plan to automate this process to make it easier. This took me about 4 hours doing it by hand. 

 

Thanks in advance!

 

 

I attached a photo, but also copied and pasted the table on here to make it easier to see, but I couldn't highlight the blank spaces, therefore I simply typed in GAP which is left blank in the excel document if that makes sense:

 

E332023/01/2210:28:000.00035
E342023/01/2210:30:000.00035
E352023/01/2210:32:000.00035
E362023/01/2210:34:000.00035
E372023/01/2210:36:000.000 GAP
E382023/01/2210:38:000.00032295
E392023/01/2210:40:000.000 GAP
E402023/01/2210:42:000.0001052560
E412023/01/2210:44:000.00025602889
E422023/01/2210:46:000.00027092872
E432023/01/2210:48:000.00032920
E442023/01/2210:50:000.00035
E452023/01/2210:52:000.00035
E462023/01/2210:54:000.00035
E472023/01/2210:56:000.00031752
E482023/01/2210:58:000.00017521979

 

 

  • jazzyelsie 

    For such model

    as variant

    =LET(
        less,      value < 10,
        stop,      TOCOL(time / IFNA((less)*(DROP(value,1) >= 10),1), 2),
        start,     TOCOL(time / (less * VSTACK(0, DROP(value, -1) >= 10)), 2),
        VSTACK({"start","stop"}, HSTACK(start, stop))
    )
    • jazzyelsie's avatar
      jazzyelsie
      Copper Contributor
      This is a bit confusing. Would I be putting that formula in the start and stop time column after I create it? Also, I do not believe this would work because the stop time for the first row would be 9:30. It starts at 9:10, but has to include the last value therefore it stops after 9:25 is finished, so I use the 9:30:00 value if that makes sense. The next stop time would be 10:35, and the third would be whatever row is after 11:25
      • SergeiBaklan's avatar
        SergeiBaklan
        MVP

        jazzyelsie 

        If stop is next greater than 10, it could be

        =LET(
            less,      value < 10,
            more,      value >= 10,
            skipFirst, DROP(value, -1),
            stop,      TOCOL(time / VSTACK(DROP(VSTACK(0, skipFirst < 10) * more, -1), 1), 2),
            start,     TOCOL(time / (less * VSTACK(0, skipFirst > 10)), 2),
            VSTACK({"start","stop"}, HSTACK(start, stop))
        )

        I assume the last record in the range is also "stop"

        Entire formula is entered in E3 here

        It generates everything, includes headers. The only is to apply formats.

  • GeorgieAnne's avatar
    GeorgieAnne
    Iron Contributor

    Hello jazzyelsie,

     

    Try something like this:

    =LOOKUP(2,1/(I:I=$N1),F:F)

     

    In Column I you have what you want to look for values

    In N1 you have what you want to count < 5

    In Column F you have what you want to return, the dates.

     

    It would always be a good thing to include the Column letters and row numbers so that we can see the layout of your worksheet and get you a formula that works for your example!

     

    HTH

    • jazzyelsie's avatar
      jazzyelsie
      Copper Contributor
      You're right. I should've included the column letters. The left side are the row numbers, but it is shown in the attached Excel file. I will definitely make that clear next time I post, thank you ๐Ÿ™‚
      For the lookup formula, if I need the stop time of the row right after the conditional format highlights, would I add a 1? I'm not sure if that makes sense.

Resources