• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Calculating average hour by day with a Pivot Table|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Calculating average hour by day with a Pivot Table|General Excel Questions & Answers|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Calculating average hour by day wit…
sp_PrintTopic sp_TopicIcon
Calculating average hour by day with a Pivot Table
Page: 12Jump to page
Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
1
November 30, 2019 - 2:12 am
sp_Permalink sp_Print

I'm trying to calculate the average per hour for each day from my Pivot Table. I don't have Power Pivot as an option.  What is the recommend formula. Also I will be adding additional days every week.

see attached file.

Thanks

sp_AnswersTopicSeeAnswer See Answer
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4524
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
November 30, 2019 - 8:58 am
sp_Permalink sp_Print

Hi John,

Seeing that you don't have Power Pivot. I'd use Power Query to aggregate the data the way you need because formulas are going to be overly complex and at risk of errors over time as your data grows. With Power Query you can add data to the table in Sheet1 and simply click the Refresh All button on the Data tab and it will update.

See file attached. Note: I deleted most of your data to reduce the file size.

Mynda

Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
3
December 5, 2019 - 7:39 am
sp_Permalink sp_Print

Hi Mynda,

I'm still struggling with this report.  I decided to start to by extracting one days worth of data and use a Pivot Table to evaluate the average time per hour.  If I have done this correctly then I want to upload each day going forward.

Can you let me know if I'm on the right track? Also I inserted a Slicer but what really need is to be able to create a table that captures each new day that is uploaded with the "Daily Average". 

Lastly the date and time are not properly formatted when I extract it from my system.  Do you recommend that I create macro to format it or should I manually updated it prior to uploading the main file?

I have attached the file for your review.

Thanks for your help.

John

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4524
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
December 5, 2019 - 8:58 am
sp_Permalink sp_Print

Hi John,

The file you attached is the same as your original file. I've deleted it to save space on our servers. In regards to fixing your date format, you can automate this with Power Query, no need for VBA.

Mynda

Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
5
December 6, 2019 - 1:48 am
sp_Permalink sp_Print

Sorry, I selected the wrong file. I have now attached the correct file.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4524
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
6
December 9, 2019 - 8:35 am
sp_Permalink sp_Print

Hi John,

Thanks for uploading the correct file. The date format appears to have already been fixed in your source data, so I can't help you with an example using Power Query to fix it.

In regards to the average time calculation. It's calculating correctly, although I'm not sure what value it provides, but you know your business better than I do. 

Mynda

Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
7
December 9, 2019 - 9:14 am
sp_Permalink sp_Print

Hi Mynda,

Thanks for your reply. 

The problem I'm having is how to upload additional dates to capture the Average per hour.  I update a file with a table but I'm not sure where to go from here.  Also is there a way to compress the data to avoid the file becoming too large?

 

Thanks

John

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4524
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
8
December 9, 2019 - 9:32 am
sp_Permalink sp_Print

What do you mean by 'upload', where is the data coming from and where do you want it to go?

Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
9
December 10, 2019 - 1:08 am
sp_Permalink sp_Print

I guess I shouldn't have used the word upload.  I want to add future date data to the existing Excel file and I'm concerned it will become too large of a file for my laptop.

Thanks

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 873
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
10
December 10, 2019 - 5:25 am
sp_Permalink sp_Print

Hello John,

Have you read this article on how update data from files in a folder using Power Query? I believe that is the best approach for you. Not sure of how familiar you are with Power Query, but here is a good article about it. I can also recommend this course, it helped me a lot to start using PQ.

With PQ you can choose to only link your data, so the file which you work with will not grow to much in file size, as the raw data will be in all the files in that folder. Give it a try, if you haven’t already.

sp_AnswersTopicAnswer
Answers Post
Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
11
December 14, 2019 - 6:42 am
sp_Permalink sp_Print

Thank you Anders,

This is very helpful

Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
12
December 16, 2019 - 10:54 am
sp_Permalink sp_Print

Hi,

I tried the Power Query and it helped me to obtain the data and organized it.  The problem I still have is calculating the average minutes for each hour.  I have attached a portion of my file which list all the hours within one day with the related order numbers processed during the hour.

Please let me know if you can help.

Thanks,

John

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4524
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
13
December 16, 2019 - 1:08 pm
sp_Permalink sp_Print

Hi John,

Nothing attached. You need to click the yellow 'Start upload' button after selecting your file.

Mynda

Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
14
December 16, 2019 - 11:17 pm
sp_Permalink sp_Print

Hi Mynda,

Sorry, please see attached file.

Thanks

John

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4524
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
15
December 17, 2019 - 10:11 pm
sp_Permalink sp_Print

Hi John,

Sorry, but I don't know what you mean by 'calculating the average minutes for each hour'. The average minutes in an hour is 60 😉

I was hoping your file would contain an example of what you'd like the output to be. i.e. what cells would you reference, what calculation would you do, what is the end result based on a sample of your data? 

I don't understand the objective of the task at hand. Hopefully you can explain what you're trying to do in reference to your data. From there I can try to help you.

Mynda

Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
16
December 18, 2019 - 12:23 am
sp_Permalink sp_Print sp_EditHistory

Hi Mynda,

Sorry for all the confusion.

Basically I am trying to calculate the average minutes within an hour of a day to process (load trucks) tickets.

Here is the formula I would like to achieve:  

= Find "TicketTime-Hour", Average minutes within related hour in column "TicketTime"

 

see attached file.

 

Thanks

John

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4524
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
17
December 18, 2019 - 8:31 am
sp_Permalink sp_Print

Hi John,

Thanks for further clarifying, however I'd like to make sure I'm understanding correctly. You said:

"How can I report the average time it took to process tickets within the range of each hour. 

We are loading trucks and some hours are busier than others which is why I am trying to capture the number of minutes used within the hour of the day."

But your data only has a 'TicketTime' column, which I presume is the time the truck loading began, as opposed to the duration it took to load the truck. 

I would have thought that you need the start and finish times for each truck load in order to calculate the 'average time it took to process tickets'? I just don't think your data will give you the information you're after.

You might be better off plotting a box and whisker chart that shows the first and last ticket times and the ticket count to give a perspective of the time range the trucks are being loaded in and the number of trucks in that time range.

Mynda

Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
18
December 20, 2019 - 5:27 am
sp_Permalink sp_Print

Hi Mynda,

I attached a file that contains more frequency of ticket time (loading times) to demonstrate the data I'm trying to capture.

Hopefully this will help clarify my challenge.

Thanks again for your help.

John

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4524
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
19
December 21, 2019 - 12:40 pm
sp_Permalink sp_Print

Hi John,

I'd use Power Query to calculate the 'Minutes from Last Ticket' and then you can use the PivotTable to average. See Sheet2 of file attached. 

Mynda

Avatar
John Fazio
Member
Members

Dashboards

Power Pivot

Power Query
Level 0
Forum Posts: 27
Member Since:
June 7, 2019
sp_UserOfflineSmall Offline
20
December 24, 2019 - 2:40 am
sp_Permalink sp_Print

Thanks Mynda,

I appreciate all your help.

I signed up for your Power Query course to help me better understand the application. 

 

John

Page: 12Jump to page
sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Orlando Menes, Alicia Greynolds
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Blair Gallagher
Brandi Taylor
Hafiz Ihsan Qadir
Gontran Bage
adolfo casanova
Annestine Johnpulle
Priscila Campbell
Jeff Mikles
Aaron Butler
Maurice Petterlin
Forum Stats:
Groups: 3
Forums: 24
Topics: 6369
Posts: 27852

 

Member Stats:
Guest Posters: 49
Members: 32359
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.