Formula for adding up minutes

Nelly3007

New Member
Joined
Jan 16, 2020
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have got a log of minutes and each set of minutes has a category. I want to add up the minutes for each category at the top of the sheet as you can see. I thought a SUM would work and have tried '=SUMIFS(F2:F100,H2:H100,"Work")' - this seems to know they are minutes but also brings up 0:00:00. Any suggestions please?

Thank you
 

Attachments

  • Capture.JPG
    Capture.JPG
    120.4 KB · Views: 11

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I'll bet that you want:
Excel Formula:
=SUMIFS(f2:f100,h2:h100,"Work")*60*24
And format it as a number, not a time.

It's all about how excel deals with dates and times.
 
Upvote 0
Thanks for you reply, however, this still brings up zero on all cells; I have tried the 'minutes' column formatted as minutes and number, the 'total' cells formatted as minutes and number, still the same result :cry:. Also tried the formula the other way round in case I had done it wrong. There must be something easy and glaringly obvious that I am missing.
 

Attachments

  • Capture.png
    Capture.png
    62.9 KB · Views: 9
Upvote 0
It looks to me like you just have the columns wrong in your formula. You are trying to add column F, which is blank, based on column H, which is also blank.

Try like this. The possible problem is that I note column G in your image is left-aligned which may mean that the times are text and not numerical?

BTW, I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.
22 06 07.xlsm
EFGHIJ
1CategorySub categoryTotal Minutes
2Personal0:20Work1:28
3Work0:06Interruption0:04
4Interruption0:01Personal0:20
5Interruption0:03
6Work0:05
7Work0:57
8Work0:09
9Work0:11
Minutes
Cell Formulas
RangeFormula
J2:J4J2=SUMIFS(G$2:G$100,E$2:E$100,I2)
 
Last edited:
Upvote 0
Another option would be to use Excel's built-in Pivot Table feature (on the Insert ribbon tab)

22 06 07.xlsm
EFGHIJK
1CategorySub categoryTotal MinutesRow LabelsSum of Total Minutes
2Personal0:20Personal0:20
3Work0:06Work1:28
4Interruption0:01Interruption0:04
5Interruption0:03Grand Total1:52
6Work0:05
7Work0:57
8Work0:09
9Work0:11
10
Minutes (2)
 
Upvote 0
Sorry Peter_SSs, I am a bit confused by your response as column F and H both contain data. I am trying to add up the minutes in column H based on the data in column F. So each time a cell in column F says 'Work' it will add up the amount of minutes in column H and give me a total for the day.

Currently, column H is set as number.

Log (1).xlsx
CDEFGHIJKL
1Start timeEnd timeTaskCategorySub categoryTotal minutes373
208:25:0008:32:00Logging in, washing glass, setting upPersonal0:07Total Work here
308:32:0008:35:00Visit from JBInterruption0:03Total Personal here
408:36:0008:54:00Clear emails that don’t need actioningWork0:18Total Interruption here
508:54:0008:55:00Updating PO numbersWork0:01Total Break here
608:55:0008:57:00LG - discuss new lock on fuel tankInterruption0:02Total Meeting here
708:56:0008:58:00RH called - send email fro blast tomorrowInterruption0:02
808:59:0009:09:00Updating PO numbers and sending out Samson orderWork0:10
909:09:0009:12:00Call from CertasInterruption0:03
1009:14:0009:22:00ReconcilingWork0:08
1109:22:0009:23:00Call from CertasInterruption0:01
1209:23:0009:56:00ReconcilingWork0:33
1309:56:00#VALUE!
140:00
150:00
Tuesday
Cell Formulas
RangeFormula
H2:H15H2=TEXT(D2-C2, "h:mm")
Cells with Data Validation
CellAllowCriteria
F2:F15ListWork,Personal,Break,Interruption,Meeting
 
Upvote 0
Sorry Peter_SSs, I am a bit confused by your response as column F and H both contain data.
They don't in your post #1 image ;)

1654594436926.png


Currently, column H is set as number.
It is may be set as number but it contains text from your formula =TEXT(D2-C2, "h:mm")

I would suggest changing the column H formula so that it does return a number not text as shown below (format the column as H:MM) then SUMIFS should work for you.

22 06 07.xlsm
CDFHIJK
1Start timeEnd timeCategoryTotal minutes373CategoryTotal
208:25:0008:32:00Personal0:07Work1:10
308:32:0008:35:00Interruption0:03Personal0:07
408:36:0008:54:00Work0:18Interruption0:11
508:54:0008:55:00Work0:01Break0:00
608:55:0008:57:00Interruption0:02Meeting0:00
708:56:0008:58:00Interruption0:02
808:59:0009:09:00Work0:10
909:09:0009:12:00Interruption0:03
1009:14:0009:22:00Work0:08
1109:22:0009:23:00Interruption0:01
1209:23:0009:56:00Work0:33
1309:56:00 
14 
Minutes (3)
Cell Formulas
RangeFormula
K2:K6K2=SUMIFS(H$2:H$100,F$2:F$100,J2)
H2:H14H2=IF(D2,D2-C2,"")
 
Upvote 0
Apologies Peter_SSs, I deleted a column before I uploaded the first picture so it obviously moved my data and I didn't think 🤦‍♀️

I have just amended slightly to avoid having the list in column J but that solution has worked, thanks very much! Really appreciate it :)
 
Upvote 0
You're welcome. Glad we ended up on the same page as each other. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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