Formula to sum by month

brianfosterblack

Active Member
Joined
Nov 1, 2011
Messages
251
I need a formula to total the hours (in another worksheet but in the same workbook) I have spent on a client
In my workbook I have a "Master" sheet and from cell Master!23 downwards I have a list of all my Client worksheets in the workbooks.
Names like BigBlue, MVP, MyGas, etc. The length of this list will vary but all sheet names are 1 word.
Next to these names I have 12 columns, 1 for each month of the year - Jan to Dec
On each Client worksheet from row 4 downwards I have in column Z the date (Date format dd/mm/yyyy) I did work for the client and in column AA the hours and minutes spent on the client (Format hh:mm)
I need on the Master Sheet in each cell in the calendar a formula for each client which will add up the hours spent on the client for each month of the year.

Can someone assist with this formula.

 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi BrianFosterBlack,

You should be able to achieve this with INDIRECT. I assume your regional date format is dd/mm/yy and though mine is mm/dd/yy (a US PC) it should work with your data. Please note that all time cells should be formatted as Custom [h]:mm so they can handle accumulated time over 24 hours.

Here are my three data sheets for BigBlue, MyGas and MVP:

BrianFosterBlack.xlsx
ZAA
3DateHours
402-Feb-2112:45
503-Mar-219:00
603-Mar-213:30
705-May-212:45
806-Jun-2112:00
909-Sep-211:00
1030-Sep-213:00
11
BigBlue


BrianFosterBlack.xlsx
ZAA
3DateHours
411-Jan-211:11
510-Feb-212:10
612-Mar-213:12
711-Apr-214:11
811-May-215:11
910-Jun-216:10
1010-Jul-217:10
1130-Aug-218:30
1208-Sep-219:08
1319-Oct-2110:19
1407-Nov-2111:07
1507-Dec-2112:07
16
MyGas


BrianFosterBlack.xlsx
ZAA
3DateHours
402-Feb-2112:45
503-Mar-219:00
603-Mar-213:30
715-Mar-212:45
804-Apr-2112:00
904-Apr-2110:00
1022-Apr-2115:30
11
MVP


Here is my Master sheet with the Client names and calendar hours accumulated:

Cell Formulas
RangeFormula
C22:M22C22=EOMONTH(B22,0)+1
B23:M26B23=IF($A23="","",SUMIFS(INDIRECT($A23&"!$AA$4:$AA$999"),INDIRECT($A23&"!$Z$4:$Z$999"),">="&B$22,INDIRECT($A23&"!$Z$4:$Z$999"),"<="&EOMONTH(B$22,0)))
 
Upvote 0
Solution
Hi BrianFosterBlack,

You should be able to achieve this with INDIRECT. I assume your regional date format is dd/mm/yy and though mine is mm/dd/yy (a US PC) it should work with your data. Please note that all time cells should be formatted as Custom [h]:mm so they can handle accumulated time over 24 hours.

Here are my three data sheets for BigBlue, MyGas and MVP:

BrianFosterBlack.xlsx
ZAA
3DateHours
402-Feb-2112:45
503-Mar-219:00
603-Mar-213:30
705-May-212:45
806-Jun-2112:00
909-Sep-211:00
1030-Sep-213:00
11
BigBlue


BrianFosterBlack.xlsx
ZAA
3DateHours
411-Jan-211:11
510-Feb-212:10
612-Mar-213:12
711-Apr-214:11
811-May-215:11
910-Jun-216:10
1010-Jul-217:10
1130-Aug-218:30
1208-Sep-219:08
1319-Oct-2110:19
1407-Nov-2111:07
1507-Dec-2112:07
16
MyGas


BrianFosterBlack.xlsx
ZAA
3DateHours
402-Feb-2112:45
503-Mar-219:00
603-Mar-213:30
715-Mar-212:45
804-Apr-2112:00
904-Apr-2110:00
1022-Apr-2115:30
11
MVP


Here is my Master sheet with the Client names and calendar hours accumulated:

Cell Formulas
RangeFormula
C22:M22C22=EOMONTH(B22,0)+1
B23:M26B23=IF($A23="","",SUMIFS(INDIRECT($A23&"!$AA$4:$AA$999"),INDIRECT($A23&"!$Z$4:$Z$999"),">="&B$22,INDIRECT($A23&"!$Z$4:$Z$999"),"<="&EOMONTH(B$22,0)))
Wow! This works perfectly - Thank you so much
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,744
Members
448,989
Latest member
mariah3

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