Hello All -
I have a file containing various open/close times for customers. I want to compare the earliest and latest times for each day of the week and determine if the time that they are open each day is less than 4 hours. This would be simple enough (e.g. I could use the DateTimeDiff formula) if there were only two sets of times (e.g. Monday AM & Monday PM), but there are actually four sets of times. In addition to that, there is no consistency in the data:
Example
Customers could have their available times setup in various formats:
Monday | Monday2 | Monday3 | Monday4 | Result | LT 4 Hrs |
9:00:00 | 18:00:00 | 0:00:00 | 0:00:00 | 9:00:00 | N |
9:00:00 | 0:00:00 | 0:00:00 | 11:00:00 | 2:00:00 | Y |
0:00:00 | 0:00:00 | 9:00:00 | 12:01:00 | 3:01:00 | Y |
9:00:00 | 11:00:00 | 14:00:00 | 18:00:00 | 6:00:00 | N |
Additionally, I want to obviously apply the same logic to Monday, for all of the other days of the week AND ideally not have to write out a ton of formulas if possible.
Let me know your suggestions.
Thanks in advance!
Solved! Go to Solution.
Hi @mmaziere,
See my attached workflow and screenshot. I assigned each row an ID corresponding to the day number. Then I transposed the data and found the min and max value for the time and performed the calculation of the difference. Some additional steps needed include converting from string to datetime, filtering out the 0:00:00 values, and removing the number from the day name. If you have additional columns for the other days of the week, you'll just have to check the box for them to be included in the transpose, but it should otherwise work for every day of the week.
Amazing! Thanks for the quick response!!!