Splitting data from a week that has two months

tryingcake

New Member
Joined
Jun 19, 2008
Messages
32
Office Version
  1. 365
Platform
  1. Windows
Hi! Thank you in advance if you can help me!

I have to pull weekly data for payment on classes taught. No biggie. You teach 50 classes that week, you get paid for 50 classes. Easy until the last week of the month if it involves 2 months (say the 3/31 is on Wednesday and 4/1 is on Thursday). Classes taught are paid on full weeks. Easy Peasy. BUT - Bonuses are paid on actually months. For instance, this month The last paycheck for April will cover classes taught April 26 through May 2 and bonuses on all of April (4/1-30)only. So I need to be able to extract that last week with three different figures.

I have to factor in three different situations.

Data needed in one cell: Total classes taught for that week - No biggie. Straight forward.

Data needed in another cell: Total classes taught through 3/31 (Sunday through Wednesday)

Data needed in final cell: Total classes taught 4/1-4/3.

This information is on all on a weekly excel calendar in a workbook with a summary sheet. Each workbook is one month. They each need their own sheet due to other data also on the sheets.

I want to be able to grab week 4's data and have it extract the information automatically and carry it over to the summary sheet. Since the numbers on the calendar float around from one day to another, I've been doing it manually for 2.5 years now. There has to be an easier way.

And since the months have different numbers of days, that poses a problem beyond my skill level. Is there a way to set this up that it reads a formula on the summary page and I do not have to refigure the formulas each month? I'm open to suggestions. Thanks!
 

Attachments

  • excel week 4.JPG
    excel week 4.JPG
    29.8 KB · Views: 103
Here is a slight revision that adds an extra column for the totals that occur in the month before and the month after the current month. I changed the month-year in A3 to one that matches up with the examples above...Jan-2020 has a Monday the 27th and a Friday the 31st for direct comparisons, if a full-month solution is of any help.
MrExcel20200424.xlsx
ABCDEFGHIJK
1EOM=end of month
2BOM=beginning of month
3Jan-2020<-Mon-Yr
4SunMonTueWedThuFriSatTotal Sun-Sat1st & Last Wk BOM to Sat OR Sun to EOM1st & Last Wk total prior month OR total next month
5Week 112/2912/3012/311/11/21/31/4
6classes298761213573819
7Week 21/51/61/71/81/91/101/11
8classes121212110  
9Week 31/121/131/141/151/161/171/18
10classes0344371132  
11Week 41/191/201/211/221/231/241/25
12classes1439871244  
13Week 51/261/271/281/291/301/312/1
14classes04141181114624814
15Week 62/22/32/42/52/62/72/8
16classes04141181114   
17
tryingcake
Cell Formulas
RangeFormula
B5B5=INT((EOMONTH($A$3,-1))/7)*7+1
C15:H15,C13:H13,C11:H11,C9:H9,C7:H7,C5:H5C5=B5+1
I6,I16,I14,I12,I10,I8I6=IF(AND(EOMONTH(B5,0)>EOMONTH($A$3,0)),"",SUM(B6:H6))
J6,J16,J14,J12,J10,J8J6=IF(EOMONTH(B5,0)<EOMONTH($A$3,0),SUMIF(B5:H5,">="&EOMONTH($A$3,-1)+1,B6:H6),IF(AND(EOMONTH(B5,0)=EOMONTH($A$3,0),EOMONTH(H5,0)>EOMONTH($A$3,0)),SUMIF(B5:H5,"<="&EOMONTH($A$3,0),B6:H6),""))
K6,K16,K14,K12,K10,K8K6=IF(J6="","",I6-J6)
B7,B15,B13,B11,B9B7=H5+1
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,224,505
Messages
6,179,151
Members
452,891
Latest member
JUSTOUTOFMYREACH

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