Calculating average and total time for a category in another worksheet

leilah

New Member
Joined
Dec 5, 2017
Messages
4
Hello forum,
I am really struggling to calculate two values:
(1) Average Time Spent for a category
(2) Total Time Spent for a category

For both of these the values are in another worksheet, containing
column a: event start date time
displays as 11/3/17 10:18
column b: event stop date time
displays as 11/3/17 14:52
column c: category name

Failed Attempt to Calculate Total Time Spent for the "Salad" Category:
=SUMIFS(Sheet1!C13150:Sheet1!C13944-Sheet1!B13150:Sheet1!B13944,"Salad",Sheet1!G13150:Sheet1!G13944)

I do not have an attempt for the average time, since the total time part is not yet working.

I would be very grateful if some kind soul can help me here.

- Leila
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hello leilah, welcome to MrExcel,

SUMIFS doesn't allow you to do calculations within the formula, perhaps have one SUMIF for the total end times and subtract another SUMIF with the start times, e.g.

=SUMIF(Sheet1!G13150:G13944,"Salad",Sheet1!C13150:C13944)-SUMIF(Sheet1!G13150:G13944,"Salad",Sheet1!B13150:B13944)

Once you have the total then the average should just be that total divided by a count of "Salad", so if the above formula is in H2 then for average try

=H2/COUNTIF(
Sheet1!G13150:G13944,"Salad")
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top