Forum Discussion
Calculate Hour Type Column Difference
- 3 years ago
Hi sfernamer
Here is a sample file containing my two previously proposed solutions. You are right about the 2nd solution, there was sime mistakes. Not sure if either what you're looking for.
Hi tamerj1
Firstly, thank you for your time, looks like the solution 1 is working for what I wanted except for 1 special situation. Sometimes, there can be more than one row with the same Time_Def field (changing 2 defensive fives at the same h:mm:ss). Checking the calculation, it's calculating the difference for each of them despite the fact that one of this fields should be 0:00:00 (there is no difference). I don't know if we have to add a line of code to choose the first in order when there are some files with the same h:mm:ss.
After this, I would need to sum up like in a Pivot Table I shown above (Idk if it's possible with sumx).
Add you the example in Excel (in the same link) and the expected result in image to see if you could help me, please.
Thank you in advance.
sfernamer
That can be done but you need a sort order as it seems that defensive five don't have a specific order. Please advise.
- sfernamer3 years agoHelper III
Hi tamerj1
Firstly, thank you for your reply. That's true that I don't have a column with a specific order but, bearing in mind, we talk about game plays, I can add an index column (the order of the games is always the same, like the one shown in "Testing.xlsx").
I added it for the game with the specific problem to help you to test the change (it's a extraction of the dataset with a column index added). The name of the folder is "Testing.xlsx" with the extraction of one game with the specific problem (different values for "Defensive Five" for the same "Time_Def" column value). I highlighted in yellow the specific rows that are problem for the code (it's not recurrent but can happen in some games).
I guess it's a change in the code already working but I tried different options but not working. Could you help me, please?
Thank you in advance.