Recently, I get an interesting task. We have a database like that:
So we need to find the percent of days from total days where price was MAX. I want to do it without VBA code. So, first of all, we need to restructure our database. I need to get the structure like that.
Sure, we could use copy/paste and do it manually for each day. However, using Excel’s PivotTables feature, we can avoid this tedious work (especially if we have hundreds of thousands of lines) and let Excel do this work for us. A PivotTable is nothing more than a different, flexible view at your data. A PivotTable combines the best of subtotals, sorting, filtering and rearranging to allow us to see the data in a new view.
In this view we can easy calculate MAX and even count days where we have max value for each minute. We just create the same table and put formula:
We search MAX value of the day and if found assign 1, else – 0. Now we can easy calculate the chance of a particular minute in the day being the highest within the day. Just sum by row and divided by the number of days.
As a result, I got a graph: