You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Grouping different values by hour

Hi world,


I'm currently building a trading dashboard/journal and want to add a chart that gives me insight in how often I take a trade by each hour, win rate per hour etc.


Pivot tables creates multiple 2PM rows instead 1 when sort by weekday, that is what I'm trying to accomplish with time.


For example with 2PM. I am trying to group these trades and values under 2PM.

  • 14:00
  • 14:25
  • 14:55


I Formatted the cells to the same time format I use in another table and tried LOOKUP, VLOOKUP, SUMIF. I can't find a way to group time with values in a different table using formulas and pivot tables.



It would be very useful for me to have the same chart and ease for a hour chart as I have for weekday my weekday chart.


Hopefully someone can push me to the right direction


Posted on Nov 17, 2024 9:11 AM

Reply
6 replies

Nov 17, 2024 10:20 PM in response to Steenkool

Steenkool wrote:

I can't find a way to group time with values in a different table using formulas and pivot tables.


Pivot Tables, as you have discovered, can easily aggregate (group) data by quarter, month, day of week, etc. Very convenient! Alas, there is not a built-in option for hour.


But you can add a column that uses the HOUR function to retrieve the hour and base the pivot table on that column:



In C2 of the example filled down:


=HOUR(A2)


If you want to get fancier (perhaps for consistency of formatting with other charts) and have date-time in a column rather than a decimal hour then you can do this in D2, filled down:


=TODAY()+DURATION(,,C2)



By adding the hour to TODAY you ensure that all the time components in the date-time value in the cell are on the same day.


And in the Pivot Table choose Group By: Value




Replace , in the formulas with ; if your region uses , as the decimal separator.


And note that those strange-looking leading , (or ;) in the DURATION function are needed here.


More on functions used:


HOUR - Apple Support

DURATION - Apple Support



SG







Nov 18, 2024 7:28 AM in response to Steenkool

Glad to hear it helped!


I was puzzled by your question about ASC until I saw the file name of my Numbers document appears in my screenshot. That simply stands for Apple Support Community. I don't know enough to be a consultant. 😀


I hope you noticed that I only included a Gain column in the simple example. No Loss column. For good luck!


SG

Nov 18, 2024 7:12 PM in response to Steenkool

Nice looking charts!


Not sure how to interpret 14:00. (At first glance, one gets the impression results were positive in one chart but negative in the other.)


Remember you also have the option of a 2-Axis Chart. If you haven't seen it already, have a look at the working example in the 'Charting Basics' template at File > New in the menu.


SG

Grouping different values by hour

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.