Sum of range

tkellymd

New Member
Joined
May 29, 2017
Messages
12
I need to calculate the total amount due for a client. I have a range of cells that list the service provider (C9:E39), the amount of hours provided (B9), and the provider's hourly rate (Total Hours J6) which corresponds to the provider (Total Hours B6). Total hours B6 and J6 vary by provider but correlate for each provider.

I have figured out how to calculate the total to invoice per provider as:


=B9*'Total Hours'!J6*COUNTIF(C9:E39,'Total Hours'!B6)

but am unable to figure out how to use a sum or sumif function to calculate the total amount provided by all providers for the whole range (C9:E39) with out adding the above formula for each provider.

How can I reduce this to one formula?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Sorry it's not clear to me even what your current formula is doing.

Can you please post a screenshot to illustrate?
 
Upvote 0
The simplified version of the formula is:

= hours per shift *provider's hourly rate * total shifts per provider

 
Upvote 0
I'm guessing you want something like this:

F10:=COUNTIF(A$3:C$7,E10)*VLOOKUP(E10,E$2:F$6,2,)
F11: =SUMPRODUCT(F2:F6,COUNTIF(A3:C7,E2:E6))

If the number of hours per shift is always the same, as you've shown, then you could just multiply the result by the shift length in hours. Do you need to allow for variable length shifts?


Excel 2010
ABCDEF
1ShiftsRate
2Place APlace BPlace CBob$15
3BobCarol$20
4CarolTed$12
5TedAliceAlice$18
6TedBill$16
7BobCarol
8
9Totals
10Carol$40
11ALL$112
1


If I'm on the wrong path please post screenshots, rather than pictures, of what your sample data looks like, and what results you're expecting to see.

Part B here gives you some options for posting screenshots:
https://www.mrexcel.com/forum/board-announcements/127080-guidelines-forum-use.html
 
Last edited:
Upvote 0

Book1
ABCDEFGH
6MHHSMethodistSt. Luke'sHCA
7DayHours WorkedIntensivistIntensivistIntensivistIntensivistIntensivistIntensivist
81.10
92.10
103.10
114.10
125.10
136.10
147.10
158.10
169.10
1710.10
1811.10
1912.10
2013.10
2114.10
2215.10
2316.10
2417.10
2518.10
2619.10
2720.10
2821.10
2922.10
3023.10
3124.10
3225.10
3326.10
3427.10
3528.10
3629.10
3730.10
3831.10
39
40Total Hours0000
41Amount due
42
43Rate/Hr
44MHHSMethodistSt. Luke'sHCA
45General$ 150.00
46CV$ 163.50
47Blended$ 180.00
OR Hours
Cell Formulas
RangeFormula
D40=B38*COUNTIF(C8:C38,"*")
F40=B38*COUNTIF(F8:F38,"*")
G40=C38*COUNTIF(G8:G38,"*")
H40=D38*COUNTIF(H8:H38,"*")
 
Upvote 0

Book1
BCDEFGHIJ
2Total Hours
3
4
5ICU AM HoursICU PM HoursOR HoursVacation HoursTotal Hours for MonthCritical Care TrainingAdministrative HoursOR Hourly Rate
6Kelly16154.500216Certified0$ 180.00
7Khawaja1415400195Certified0
8Tanauli1446800212Certified0$ 180.00
9Bell1652700192Certified0
10Miller7440.500114Certified0$ 163.50
11Deljoui016200162Certified0
12Faisal00000Certified0
13Badar2600026Certified0
14Salcedo3400034Certified0
15Grewal10513.500119Certified0
16Contreras7413.50087Certified0
17Hammoudeh6000060Certified0
18Mutyala7400074Certified0
19Haider00000Certified0
20Meeks8010000180Certified0
21Zubieta1009800198Certified0
22Retz709800168Certified0
23Agbo6014000200Certified0
24Pulimamidi1703200202Certified0
Total Hours
Cell Formulas
RangeFormula
C6=MHSW!L9+MHSW!N9+MHNE!H9+TRMC!H9
C7=MHSW!L10+MHSW!N10+MHNE!H10+TRMC!H10
C8=MHSW!L11+MHSW!N11+MHNE!H11+TRMC!H11
C9=MHSW!L12+MHSW!N12+MHNE!H12+TRMC!H12
C10=MHSW!L13+MHSW!N13+MHNE!H13+TRMC!H13
C11=MHSW!L14+MHSW!N14+MHNE!H14+TRMC!H14
C12=MHSW!L15+MHSW!N15+MHNE!H15+TRMC!H15
C13=MHSW!L16+MHSW!N16+MHNE!H16+TRMC!H16
C14=MHSW!L17+MHSW!N17+MHNE!H17+TRMC!H17
C15=MHSW!L18+MHSW!N18+MHNE!H18+TRMC!H18
C16=MHSW!L19+MHSW!N19+MHNE!H19+TRMC!H19
C17=MHSW!L20+MHSW!N20+MHNE!H20+TRMC!H20
C18=MHSW!L21+MHSW!N21+MHNE!H21+TRMC!H21
C19=MHSW!L22+MHSW!N22+MHNE!H22+TRMC!H22
C20=MHSW!L23+MHSW!N23+MHNE!H23+TRMC!H23
C21=MHSW!L24+MHSW!N24+MHNE!H24+TRMC!H24
C22=MHSW!L25+MHSW!N25+MHNE!H25+TRMC!H25
C23=MHSW!L26+MHSW!N26+MHNE!H26+TRMC!H26
C24=MHSW!L27+MHSW!N27+MHNE!H27+TRMC!H27
D6=MHSW!M9+MHNE!I9+TRMC!I9+'Tele-ICU'!F7
D7=MHSW!M10+MHNE!I10+TRMC!I10+'Tele-ICU'!F8
D8=MHSW!M11+MHNE!I11+TRMC!I11+'Tele-ICU'!F9
D9=MHSW!M12+MHNE!I12+TRMC!I12+'Tele-ICU'!F10
D10=MHSW!M13+MHNE!I13+TRMC!I13+'Tele-ICU'!F11
D11=MHSW!M14+MHNE!I14+TRMC!I14+'Tele-ICU'!F12
D12=MHSW!M15+MHNE!I15+TRMC!I15+'Tele-ICU'!F13
D13=MHSW!M16+MHNE!I16+TRMC!I16+'Tele-ICU'!F14
D14=MHSW!M17+MHNE!I17+TRMC!I17+'Tele-ICU'!F15
D15=MHSW!M18+MHNE!I18+TRMC!I18+'Tele-ICU'!F16
D16=MHSW!M19+MHNE!I19+TRMC!I19+'Tele-ICU'!F17
D17=MHSW!M20+MHNE!I20+TRMC!I20+'Tele-ICU'!F18
D18=MHSW!M21+MHNE!I21+TRMC!I21+'Tele-ICU'!F19
D19=MHSW!M22+MHNE!I22+TRMC!I22+'Tele-ICU'!F20
D20=MHSW!M23+MHNE!I23+TRMC!I23+'Tele-ICU'!F21
D21=MHSW!M24+MHNE!I24+TRMC!I24+'Tele-ICU'!F22
D22=MHSW!M25+MHNE!I25+TRMC!I25+'Tele-ICU'!F23
D23=MHSW!M26+MHNE!I26+TRMC!I26+'Tele-ICU'!F24
D24=MHSW!M27+MHNE!I27+TRMC!I27+'Tele-ICU'!F25
E6='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B6)
E7='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B7)
E8='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B8)
E9='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B9)
E10='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B10)
E11='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B11)
E12='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B12)
E13='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B13)
E14='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B14)
E15='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B15)
E16='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B16)
E17='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B17)
E18='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B18)
E19='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B19)
E20='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B20)
E21='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B21)
E22='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B22)
E23='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B23)
E24='OR Hours'!B38*COUNTIF('OR Hours'!C8:H38,B24)
J6='OR Hours'!D47
J8='OR Hours'!D47
J10='OR Hours'!D46
G6=SUM(C6:F6)+I6
G7=SUM(C7:F7)+I7
G8=SUM(C8:F8)+I8
G9=SUM(C9:F9)
G10=SUM(C10:F10)
G11=SUM(C11:F11)
G12=SUM(C12:F12)
G13=SUM(C13:F13)
G14=SUM(C14:F14)
G15=SUM(C15:F15)
G16=SUM(C16:F16)
G17=SUM(C17:F17)
G18=SUM(C18:F18)
G19=SUM(C19:F19)
G20=SUM(C20:F20)+I20
G21=SUM(C21:F21)
G22=SUM(C22:F22)
G23=SUM(C23:F23)
G24=SUM(C24:F24)
 
Upvote 0
Your function =B8*(SUMPRODUCT('Total Hours'!J6:J24,COUNTIF(H8:H38,'Total Hours'!B6:B24))) worked perfectly. thank you very much.
 
Upvote 0

Forum statistics

Threads
1,223,247
Messages
6,171,007
Members
452,374
Latest member
keccles

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