Sum of hours across two or more column cell range based on criteria

aspring

New Member
Joined
May 7, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, I am currently using the following formula to calculate total hours worked at specified locations: VS or GG
Following is what I am using =SUMIF($C4:$C5, "VS",E4:E5)

Now as I am now dealing with more then one person, is there an easier way to have the same formula under each name (for the end of day), without having to fine tune to specific cells within a column of cells?
That way I can just copy and paste the formula for each day and under each person (editing the formula for the location).

Hope this makes sense, and welcome any suggestions to make an easier solution. :)

LocationHrs.xlsx
ABCDEFGHIJKLMNOPQRS
1Cleaning & MaintenanceTotal VSTotal GG
2DayDateLocaleTypeTotal TimeDayDaySubTWkDayDaySubTWk
3CLvsCLggTMvsTmggRPvsRPggDLvsCLTMCLTM
4Mon3-Apr-23VS2:003:00
5Mon3-Apr-23GG1:003:002:003:005:001:003:004:00
6Tue4-Apr-23VS4:00
7Tue4-Apr-23GG4:004:004:008:004:000:004:00
8Wed5-Apr-23VS3:008:00
9Wed5-Apr-23GG5:003:005:008:005:000:005:00
10Thu6-Apr-23VS5:004:00
11Thu6-Apr-23GG3:005:003:008:003:000:003:00
12Fri7-Apr-23VS1:00
13Fri7-Apr-23GG1:000:001:000:000:000:00
14End of Week46:0030:0016:00
Sheet1
Cell Formulas
RangeFormula
L5,L13,L11,L9,L7L5=SUMIF($C4:$C5, "VS",E4:E5)
M5M5=SUMIF($C4:$C5, "VS",G4:G5)
N5,R13,N13,R11,N11,R9,N9,R7,N7,R5N5=SUM(L5:M5)
P5,P13,P11,P9,P7P5=SUMIF($C4:$C5, "GG",F4:F5)
Q5,Q13,Q11,Q9,Q7Q5=SUMIF($C4:$C5, "GG",H4:H5)
M7,M13,M11,M9M7=SUMIF($C6:$C7, "GG",F6:F7)
A4:A13A4=TEXT(B4,"ddd")
D14D14=SUM(O14+S14)
O14,S14O14=SUM(N4:N13)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A5:C5Expression=MOD(ROW(),2)textNO
A4:C4Expression=MOD(ROW(),2)textNO
Q5:R5Expression=MOD(ROW(),2)textNO
P5Expression=MOD(ROW(),2)textNO
M5:N5Expression=MOD(ROW(),2)textNO
L5Expression=MOD(ROW(),2)textNO
O5Expression=MOD(ROW(),2)textNO
Q13:R13Expression=MOD(ROW(),2)textNO
P13Expression=MOD(ROW(),2)textNO
N13Expression=MOD(ROW(),2)textNO
L13Expression=MOD(ROW(),2)textNO
M13Expression=MOD(ROW(),2)textNO
M11Expression=MOD(ROW(),2)textNO
M9Expression=MOD(ROW(),2)textNO
M7Expression=MOD(ROW(),2)textNO
E9:F9Expression=MOD(ROW(),2)textNO
E8:F8Expression=MOD(ROW(),2)textNO
Q11:R11Expression=MOD(ROW(),2)textNO
P11Expression=MOD(ROW(),2)textNO
N11Expression=MOD(ROW(),2)textNO
L11Expression=MOD(ROW(),2)textNO
O11Expression=MOD(ROW(),2)textNO
Q9:R9Expression=MOD(ROW(),2)textNO
P9Expression=MOD(ROW(),2)textNO
Q7:R7Expression=MOD(ROW(),2)textNO
P7Expression=MOD(ROW(),2)textNO
N7Expression=MOD(ROW(),2)textNO
L7Expression=MOD(ROW(),2)textNO
N9Expression=MOD(ROW(),2)textNO
L9Expression=MOD(ROW(),2)textNO
K11Expression=MOD(ROW(),2)textNO
E11:G11Expression=MOD(ROW(),2)textNO
S11,H11:J11,A11:D11Expression=MOD(ROW(),2)textNO
K9Expression=MOD(ROW(),2)textNO
O9Expression=MOD(ROW(),2)textNO
G9Expression=MOD(ROW(),2)textNO
S9,A9:D9,H9:J9Expression=MOD(ROW(),2)textNO
K7Expression=MOD(ROW(),2)textNO
O7Expression=MOD(ROW(),2)textNO
E7:G7Expression=MOD(ROW(),2)textNO
S7,A7:D7,H7:J7Expression=MOD(ROW(),2)textNO
K8Expression=MOD(ROW(),2)textNO
L8:O8Expression=MOD(ROW(),2)textNO
G8Expression=MOD(ROW(),2)textNO
P8:S8,A8:D8,H8:J8Expression=MOD(ROW(),2)textNO
K10Expression=MOD(ROW(),2)textNO
R10Expression=MOD(ROW(),2)textNO
P10Expression=MOD(ROW(),2)textNO
Q10Expression=MOD(ROW(),2)textNO
M10:N10Expression=MOD(ROW(),2)textNO
L10Expression=MOD(ROW(),2)textNO
O10Expression=MOD(ROW(),2)textNO
E10:G10Expression=MOD(ROW(),2)textNO
S10,H10:J10,A10:D10Expression=MOD(ROW(),2)textNO
K12:K13,K4:K6Expression=MOD(ROW(),2)textNO
O13Expression=MOD(ROW(),2)textNO
S13Expression=MOD(ROW(),2)textNO
S14Expression=MOD(ROW(),2)textNO
R14Expression=MOD(ROW(),2)textNO
O14Expression=MOD(ROW(),2)textNO
Q14Expression=MOD(ROW(),2)textNO
P14Expression=MOD(ROW(),2)textNO
M14:N14Expression=MOD(ROW(),2)textNO
L14Expression=MOD(ROW(),2)textNO
M4:N4Expression=MOD(ROW(),2)textNO
P4Expression=MOD(ROW(),2)textNO
L4,O4,L6:O6,L12:O12Expression=MOD(ROW(),2)textNO
E5:G5Expression=MOD(ROW(),2)textNO
D5Expression=MOD(ROW(),2)textNO
E4:G4,E12:G14,E6:G6Expression=MOD(ROW(),2)textNO
D4,H14:K14,Q4:S4,P6:S6,S5,A12:D14,H12:J13,P12:S12,A6:D6,H4:J6Expression=MOD(ROW(),2)textNO
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Oh dear... I can see that some of the formulas (in red) in my sample are showing incorrect figures... :(
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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