Merge "like rows" and sum the "Total Hours" value

Clooney

New Member
Joined
Sep 28, 2012
Messages
41
Office Version
  1. 365
Platform
  1. Windows
So I have this data set that I use weekly for my employees. No idea why this is happening but it is now splitting the "Regular" Pay Code column up and its wreaking havoc with a company wide spreadsheet.

What I want to do is merge the employees who have these 2 "Regular" Pay Code rows merged into one row and have the Actual Total hours column summed but leave the rest of the list intact. Hopefully my image shows better at what I am trying to explain.
 

Attachments

  • 2022-08-02 14_29_57-2W Payroll 07312022.xls - Excel.png
    2022-08-02 14_29_57-2W Payroll 07312022.xls - Excel.png
    55.2 KB · Views: 10
Try this :

Book4
ABCDEFGHIJKLMNO
1Raw DataResult
2Employee Full NameEmployee IDPositionCustom FieldPay CodeShiftActual Total Hours (Include Corrections)Employee Full NameEmployee IDPositionCustom FieldPay CodeShiftActual Total Hours (Include Corrections)
3Ashley, Adam M2645Regular130-1-Lebanon $0.032Ashley, Adam M264500Regular130-1-Lebanon $0.040.00
4Ashley, Adam M2645RegularSemi-Mon8Ashley, Elizabeth1793300Overtime130-1-Lebanon $0.03.17
5Ashley, Elizabeth17933Overtime130-1-Lebanon $0.03.17Ashley, Elizabeth1793300Personal U130-1-Lebanon $0.08.00
6Ashley, Elizabeth17933Personal U130-1-Lebanon $0.08Ashley, Elizabeth1793300Regular130-1-Lebanon $0.032.00
7Ashley, Elizabeth17933Regular130-1-Lebanon $0.032Ayers, Larry D21384WAREASSOC0Termination1-
8Ayers, Larry D21384WAREASSOCTermination10Baker, Ann M1893300Overtime130-3-Lebanon $1.08.08
9Baker, Ann M18933Overtime130-3-Lebanon $1.08.08Baker, Ann M1893300Regular130-3-Lebanon $1.040.00
10Baker, Ann M18933Regular130-3-Lebanon $1.08Baker, Jerry L1041100Regular130-1-Lebanon $0.040.00
11Baker, Ann M18933Regular130-3-Lebanon $1.022.97Bills, Leon1941800Overtime130-1-Lebanon $0.010.97
12Baker, Ann M18933Regular19.03Bills, Leon1941800Regular130-1-Lebanon $0.040.00
13Baker, Jerry L10411Regular130-1-Lebanon $0.040Boula, Jean-Claude E1043800Overtime130-1-Lebanon $0.010.43
14Bills, Leon19418Overtime130-1-Lebanon $0.010.97Boula, Jean-Claude E1043800Regular130-1-Lebanon $0.040.00
15Bills, Leon19418Regular130-1-Lebanon $0.040Boyer, Homer W2153800Overtime130-2-Lebanon $1.03.47
16Boula, Jean-Claude E10438Overtime130-1-Lebanon $0.010.43Boyer, Homer W2153800Regular130-2-Lebanon $1.040.00
17Boula, Jean-Claude E10438Regular130-1-Lebanon $0.040Broach, Allison R2136100Overtime130-1-Lebanon $0.015.63
18Boyer, Homer W21538Overtime130-2-Lebanon $1.03.47Broach, Allison R2136100Regular130-1-Lebanon $0.040.00
19Boyer, Homer W21538Regular130-2-Lebanon $1.040 
20Broach, Allison R21361Overtime130-1-Lebanon $0.015.63
21Broach, Allison R21361Regular130-1-Lebanon $0.040
Sheet1
Cell Formulas
RangeFormula
I2:O2I2=A2:G2
I3:M18I3=UNIQUE(A3:E21)
N3:N19N3=IF(I3<>"",XLOOKUP(I3&"!"&M3,A$3:A$21&"!"&E$3:E$21,F$3:F$21),"")
O3:O19O3=IF(I3<>"",SUMIFS(G$3:G$21,A$3:A$21,I3,E$3:E$21,M3),"")
Dynamic array formulas.
This works perfect once you delete all the values that appear in column C.


Thank you very much!
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,214,922
Messages
6,122,281
Members
449,075
Latest member
staticfluids

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