Split weekly time card data into monthly totals

excel-er-8

New Member
Joined
Jun 8, 2007
Messages
12
Office Version
  1. 2016
Platform
  1. Windows
Hi all,

I have the following weekly time card data. I'm looking for a formula for the Jan 21 thru Apr 21 columns to total the portion of the hours that belong to each month. (I've pre-filled Jan 21 thru Apr 21 with what I expect the results to be from a formula.)

Hoping someone has an idea for this puzzle. Thank you!

Week starts onSundayMondayTuesdayWednesdayThursdayFridaySaturdayJan 21Feb 21Mar 21Apr 21
2021-01-03​
0.00​
8.00​
8.00​
8.00​
8.00​
8.00​
0.00​
40.00​
2021-01-24​
0.00​
8.00​
8.00​
8.00​
8.00​
8.00​
0.00​
40.00​
2021-01-31​
8.00​
8.00​
8.00​
8.00​
8.00​
0.00​
0.00​
8.00​
32.00​
2021-02-07​
8.00​
8.00​
8.00​
8.00​
8.00​
0.00​
0.00​
40.00​
2021-02-28​
8.00​
8.00​
8.00​
8.00​
8.00​
0.00​
0.00​
8.00​
32.00​
2021-03-07​
0.00​
8.00​
8.00​
8.00​
8.00​
8.00​
0.00​
40.00​
2021-03-28​
8.00​
8.00​
8.00​
8.00​
8.00​
0.00​
0.00​
8.00​
32.00​
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Try this
I have added a column after Date as month and have enter the formula as =TEXT(A2,"MMM") column B as month and formula in cell b2.
and then have enter the formula as
=IF(J$1=$B2,SUM($C2:$I2),"") for Jan column J2
=IF(K$1=$B2,SUM($C2:$I2),"") for Feb Column K2
=IF(L$1=$B2,SUM($C2:$I2),"") for Mar column L2


Date​
Month​
Sunday​
Mon​
Tue​
Wed​
Thu​
Fri​
Sat​
Jan​
Feb​
Mar​
2021-01-03​
Jan​
0.00​
8.00​
0.00​
8.00​
0.00​
0.00​
0.00​
16.00​
2021-01-24​
Jan​
0.00​
8.00​
0.00​
8.00​
0.00​
0.00​
0.00​
16.00​
2021-01-31​
Jan​
8.00​
8.00​
8.00​
8.00​
8.00​
0.00​
0.00​
40.00​
2021-02-07​
Feb​
8.00​
8.00​
8.00​
8.00​
8.00​
0.00​
0.00​
40.00​
2021-02-28​
Feb​
8.00​
8.00​
8.00​
8.00​
8.00​
8.00​
8.00​
56.00​
2021-03-07​
Mar​
0.00​
0.00​
8.00​
0.00​
0.00​
0.00​
0.00​
8.00​
2021-03-28​
Mar​
0.00​
0.00​
8.00​
0.00​
0.00​
0.00​
0.00​
8.00​
 
Upvote 0
Hi Excel-er-8,

If you'll let me have a work row then SUMIFS will do it (P.S. I believe you have the March/April for 28 March switched in your worked example).

Excel-er-8.xlsx
ABCDEFGHIJKL
10123456
2Week starts onSundayMondayTuesdayWednesdayThursdayFridaySaturdayJan-21Feb-21Mar-21Apr-21
303-Jan-21088888040   
424-Jan-21088888040   
531-Jan-218888800832  
607-Feb-218888800 40  
728-Feb-218888800 832 
807-Mar-210888880  40 
928-Mar-218888800  328
Sheet1
Cell Formulas
RangeFormula
J2:L2J2=EOMONTH(I2,0)+1
I3:L9I3=SUMIFS($B3:$H3,$B$1:$H$1,">="&I$2-$A3,$B$1:$H$1,"<="&EOMONTH(I$2,0)-$A3)
 
Upvote 0
Solution
Hi Excel-er-8,

If you'll let me have a work row then SUMIFS will do it (P.S. I believe you have the March/April for 28 March switched in your worked example).

Excel-er-8.xlsx
ABCDEFGHIJKL
10123456
2Week starts onSundayMondayTuesdayWednesdayThursdayFridaySaturdayJan-21Feb-21Mar-21Apr-21
303-Jan-21088888040   
424-Jan-21088888040   
531-Jan-218888800832  
607-Feb-218888800 40  
728-Feb-218888800 832 
807-Mar-210888880  40 
928-Mar-218888800  328
Sheet1
Cell Formulas
RangeFormula
J2:L2J2=EOMONTH(I2,0)+1
I3:L9I3=SUMIFS($B3:$H3,$B$1:$H$1,">="&I$2-$A3,$B$1:$H$1,"<="&EOMONTH(I$2,0)-$A3)

That's it! And yes, i had March/April switched. Thanks so much!
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

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