Forum

Notifications
Clear all

Large data set, filtering and determining duration between two records.

5 Posts
2 Users
0 Reactions
67 Views
(@alanr)
Posts: 79
Estimable Member
Topic starter
 

Hi there,

I hope I can explain this one clearly - just spent a very frustrating 3 hours trying to figure it out myself and failing!

The attached file has two tabs:

Data - this is a small section of the actual data set I am working with.

What I want - is a sample of what I would ideally like to be able to do with the original data set in tab "Data" (I did some extracting etc. to get the representation in the What I want tab).

Background

Every day I pull an extract from one the company databases and append the records to the bottom of the table the sample of which is shown in the "Data" tab.  The Flow Change and Time columns are not part of the original data. 

I want to be able to filter, (slicers?), on the "Name" value and see the duration difference in the "Time" column between each row record that is filtered, (you can see how I think it should look in the What I want tab).  But I get some bogus durations when I set up the filter and select a single Name value - why is that?  How to fix it?

Many thanks,

Alan

 
Posted : 21/12/2019 6:58 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Alan

The reason why your formula is not giving the result is because they are referring to the actual cells (even when they are hidden.filtered) and not the filtered cells above that you actually wanted.

My workaround is rather long and you may have to modify them to suit your needs.

I have separated the formulas into multiple helper columns so you can see what I am trying to do.

1) Column H is the key. It is a running sequence that will adjust no matter how you filter.

2) In column I, I use Match to get the row number of the cell above (I less 1 to cater for the header).

3) Column J then extract the time of the row above.

4) Column K then calculates the down time.

You can combine the above formulas into a single mega formula but it is going to be very difficult to understand and debug.

Hope this helps.

Sunny

 
Posted : 21/12/2019 9:45 pm
(@alanr)
Posts: 79
Estimable Member
Topic starter
 

Hi Sunny,

A huge help, many thanks.  Applied to the bigger data set the calculations take a little time but the result is what I wanted - many thanks.

The only other question I have is how do you manage to figure out these solutions??? 🙂

Alan

 
Posted : 25/12/2019 4:05 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Alan

If i don't know the answer I will google Laughto see if such solutions already exist (no need to recreate the wheel).

99% of the time the solution is not available but some may have partial solutions that I can use.

Column H is the key and I got it from here : https://stackoverflow.com/questions/29017096/excel-reference-a-cell-in-the-previous-visible-row

As for the other columns, I worked it out by myself.

How do I know if any partial solution will help? Well, I can only say it is thru experience/gut feeling/instinct (and many times a bit of luck Laugh)

My advice is to help others as this will allow us to learn what we don't know as every question has its own challenges that requires different solutions.

Hope I gave you some insights on my method in coming up with solutions.

Sunny

 
Posted : 26/12/2019 11:06 am
(@alanr)
Posts: 79
Estimable Member
Topic starter
 

Hi Sunny,

Many thanks for your candid and insightful response.  I like the idea that by helping others find answers you increase your own skills - seems obvious but maybe not something people readily realize - myself included - will need to fix that!

Thanks again,

Alan

 
Posted : 28/12/2019 1:35 pm
Share: