Sorting Rows into Columns

tourless

Board Regular
Joined
Feb 8, 2007
Messages
144
Office Version
  1. 365
Platform
  1. Windows
Hi Folks.

I have a file that needs some love but I'm not sure how to go about accomplishing the task. I need to compare days side by side... 2 Monday's ago to last Monday, 2 Tuesday's ago to last Tuesday, etc. There is more data than is represented here but you get the idea. I can't figure out how to run down my list and move what's needed. I'm think using dates, or recurring text in column E in conjunction with the value in column b, but I'm not sure. Any help is always greatly appreciated.

I need to turn this into this...
Hours Worked by Department - FDR.xlsx
ABCDEF
1Payroll Company CodeTimecard Work DepartmentTimecard Worked Department DescriptionDate WorkedDay WorkedHours
2252000300DISTRIBUTION10/31/2022Monday39.30
3252000300DISTRIBUTION11/01/2022Tuesday41.13
4252000300DISTRIBUTION11/02/2022Wednesday38.27
5252000300DISTRIBUTION11/03/2022Thursday45.52
6252000300DISTRIBUTION11/04/2022Friday37.20
7252000300DISTRIBUTION11/05/2022Saturday43.25
8252000300DISTRIBUTION11/07/2022Monday40.08
9252000300DISTRIBUTION11/08/2022Tuesday44.73
10252000300DISTRIBUTION11/09/2022Wednesday45.12
11252000300DISTRIBUTION11/10/2022Thursday52.82
12252000315DISTRIBUTION-DRIVER10/31/2022Monday157.82
13252000315DISTRIBUTION-DRIVER11/01/2022Tuesday198.77
14252000315DISTRIBUTION-DRIVER11/02/2022Wednesday172.78
15252000315DISTRIBUTION-DRIVER11/03/2022Thursday199.40
16252000315DISTRIBUTION-DRIVER11/04/2022Friday162.58
17252000315DISTRIBUTION-DRIVER11/05/2022Saturday128.47
18252000315DISTRIBUTION-DRIVER11/06/2022Sunday61.30
19252000315DISTRIBUTION-DRIVER11/07/2022Monday167.33
20252000315DISTRIBUTION-DRIVER11/08/2022Tuesday175.38
21252000315DISTRIBUTION-DRIVER11/09/2022Wednesday170.43
22252000315DISTRIBUTION-DRIVER11/10/2022Thursday179.87
1


Into this...
Hours Worked by Department - FDR.xlsx
ABCDEFGHI
1Payroll Company CodeTimecard Work DepartmentTimecard Worked Department DescriptionDate WorkedDay WorkedHours
2252000300DISTRIBUTION10/31/2022Monday39.3011/07/2022Monday40.08
3252000300DISTRIBUTION11/01/2022Tuesday41.1311/08/2022Tuesday44.73
4252000300DISTRIBUTION11/02/2022Wednesday38.2711/09/2022Wednesday45.12
5252000300DISTRIBUTION11/03/2022Thursday45.5211/10/2022Thursday52.82
6252000300DISTRIBUTION11/04/2022Friday37.20
7252000300DISTRIBUTION11/05/2022Saturday43.25
8
9252000315DISTRIBUTION-DRIVER10/31/2022Monday157.8211/07/2022Monday167.33
10252000315DISTRIBUTION-DRIVER11/01/2022Tuesday198.7711/08/2022Tuesday175.38
11252000315DISTRIBUTION-DRIVER11/02/2022Wednesday172.7811/09/2022Wednesday170.43
12252000315DISTRIBUTION-DRIVER11/03/2022Thursday199.4011/10/2022Thursday179.87
13252000315DISTRIBUTION-DRIVER11/04/2022Friday162.58
14252000315DISTRIBUTION-DRIVER11/05/2022Saturday128.47
15252000315DISTRIBUTION-DRIVER11/06/2022Sunday61.30
16
1
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
I've got a fairly simple method that almost gives the same output based on the example (it doesn't insert the empty row in the middle).
First, I entered the formula into G2 as shown below, then I applied a filter to column D, selecting 'Date Filter' then 'Last Week' from the filter dropdown.

tourless.xlsx
ABCDEFGHI
1Payroll Company CodeTimecard Work DepartmentTimecard Worked Department DescriptionDate WorkedDay WorkedHours
2252300DISTRIBUTION10/31/2022Monday39.311/07/2022Monday40.08
3252300DISTRIBUTION11/01/2022Tuesday41.1311/08/2022Tuesday44.73
4252300DISTRIBUTION11/02/2022Wednesday38.2711/09/2022Wednesday45.12
5252300DISTRIBUTION11/03/2022Thursday45.5211/10/2022Thursday52.82
6252300DISTRIBUTION11/04/2022Friday37.2 
7252300DISTRIBUTION11/05/2022Saturday43.25 
12252315DISTRIBUTION-DRIVER10/31/2022Monday157.8211/07/2022Monday167.33
13252315DISTRIBUTION-DRIVER11/01/2022Tuesday198.7711/08/2022Tuesday175.38
14252315DISTRIBUTION-DRIVER11/02/2022Wednesday172.7811/09/2022Wednesday170.43
15252315DISTRIBUTION-DRIVER11/03/2022Thursday199.411/10/2022Thursday179.87
16252315DISTRIBUTION-DRIVER11/04/2022Friday162.58 
17252315DISTRIBUTION-DRIVER11/05/2022Saturday128.47 
Sheet3
Cell Formulas
RangeFormula
G12:I15,G6:G7,G16:G17,G2:I5G2=FILTER($D$2:$F$22,($A$2:$A$22=A2)*($B$2:$B$22=B2)*($D$2:$D$22=(D2+7)),"")
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,214,957
Messages
6,122,472
Members
449,087
Latest member
RExcelSearch

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