SUM(IF) not working

jray9242

Board Regular
Joined
May 7, 2011
Messages
61
I am modifying a spreadsheet and now the formulas are not working. Here is what the sheet looks like:

Field "N" is the field to be totaled on. I check the "Status" field and based on this, the bottom results in "Summary" Field "D" should add up. As you can see is that it isn't adding up and I can't figure out why?

Thanks for the help.

Worksheet

*BCDEFGHIJKLMNOPQRS
MyCityABCDCDEF
CMFDFire*TLO-Intermediate*MyCityAwarenessABCDCDEF*****
HBFDFire*TLO-Intermediate*MyCityAwarenessABCDCDEF****
OCFAFire*TLO-Intermediate*MyCityAwarenessABCDCDEF*****
OCFAFire**TLO-Intermediate*MyCityAwarenessABCDCDEF*****
OFDFire*TLO-Intermediate*MyCityAwarenessABCDCDEF*****
FPDLaw Enforcement*TLO-Intermediate*MyCityAwarenessABCDCDEF*****
LBPDLaw Enforcement*TLO-Intermediate*MyCityAwarenessABCDCDEF*****
NBPDLaw Enforcement*TLO-Intermediate*MyCityAwarenessABCDCDEF*****
SAPDLaw Enforcement*TLO-Intermediate*MyCityAwarenessABCDCDEF*****
MyCityABCDCDEF

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:69px;"><col style="width:51px;"><col style="width:108px;"><col style="width:49px;"><col style="width:41px;"><col style="width:107px;"><col style="width:192px;"><col style="width:89px;"><col style="width:71px;"><col style="width:71px;"><col style="width:55px;"><col style="width:80px;"><col style="width:50px;"><col style="width:68px;"><col style="width:84px;"><col style="width:45px;"><col style="width:45px;"><col style="width:53px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]
[TD="bgcolor: #c0c0c0"]Status[/TD]
[TD="bgcolor: #c0c0c0"]Agency[/TD]
[TD="bgcolor: #c0c0c0"]Discipline[/TD]
[TD="bgcolor: #008080"]Trained[/TD]
[TD="bgcolor: #008080"]Hours[/TD]
[TD="bgcolor: #c0c0c0"]Course[/TD]
[TD="bgcolor: #008080"]Topic[/TD]
[TD="bgcolor: #c0c0c0"]Course_Loc[/TD]
[TD="bgcolor: #c0c0c0"]Start_Date[/TD]
[TD="bgcolor: #c0c0c0"]Level[/TD]
[TD="bgcolor: #c0c0c0"]Sponsor[/TD]
[TD="bgcolor: #c0c0c0"]Company[/TD]
[TD="bgcolor: #c0c0c0"]Tuition[/TD]
[TD="bgcolor: #008080, align: center"]Delivery
Cost UASI[/TD]
[TD="bgcolor: #008080, align: center"]Delivery
Cost SHSGP[/TD]
[TD="bgcolor: #008080, align: center"]LE UASI BF/OT[/TD]
[TD="bgcolor: #008080, align: center"]Fire UASI BF/OT[/TD]
[TD="bgcolor: #008080, align: center"]LE SHSGP BF/OT[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="bgcolor: #ffff00"]Pending[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]Delivery[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff, align: right"]24[/TD]
[TD="bgcolor: #00ccff"]TLO-Intermediate[/TD]
[TD="bgcolor: #00ccff"]*[/TD]

[TD="bgcolor: #00ccff, align: right"]11/29/2011[/TD]
[TD="bgcolor: #00ccff"]Awareness[/TD]

[TD="bgcolor: #00ccff, align: right"]14,950[/TD]
[TD="bgcolor: #00ccff, align: right"]14,950[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]
[TD="bgcolor: #00b050"]Completed[/TD]

[TD="align: right"]2[/TD]

[TD="align: right"]11/29/2011[/TD]

[TD="align: right"]2,559 [/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]
[TD="bgcolor: #00b050"]Completed[/TD]

[TD="align: right"]1[/TD]

[TD="align: right"]11/29/2011[/TD]

[TD="bgcolor: #ece9d8"]*[/TD]

[TD="align: right"]1,594 [/TD]

[TD="bgcolor: #cacaca, align: center"]5[/TD]
[TD="bgcolor: #00b050"]Completed[/TD]

[TD="align: right"]2[/TD]

[TD="align: right"]11/29/2011[/TD]

[TD="align: right"]2,071 [/TD]

[TD="bgcolor: #cacaca, align: center"]6[/TD]
[TD="bgcolor: #00b050"]Completed[/TD]

[TD="align: right"]11/29/2011[/TD]

[TD="align: right"]1,880 [/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]
[TD="bgcolor: #00b050"]Completed[/TD]

[TD="align: right"]3[/TD]

[TD="align: right"]11/29/2011[/TD]

[TD="align: right"]4,543 [/TD]

[TD="bgcolor: #cacaca, align: center"]8[/TD]
[TD="bgcolor: #00b050"]Completed[/TD]

[TD="align: right"]3[/TD]

[TD="align: right"]11/29/2011[/TD]

[TD="align: right"]1,510 [/TD]

[TD="bgcolor: #cacaca, align: center"]9[/TD]
[TD="bgcolor: #ffff00"]Pending[/TD]

[TD="align: right"]1[/TD]

[TD="align: right"]11/29/2011[/TD]

[TD="align: right"]1,500 [/TD]

[TD="bgcolor: #cacaca, align: center"]10[/TD]
[TD="bgcolor: #ffff00"]Pending[/TD]

[TD="align: right"]1[/TD]

[TD="align: right"]11/29/2011[/TD]

[TD="align: right"]1,500 [/TD]

[TD="bgcolor: #cacaca, align: center"]11
[/TD]
[TD="bgcolor: #ffff00"]Pending[/TD]

[TD="align: right"]1[/TD]

[TD="align: right"]11/29/2011[/TD]

[TD="align: right"]1,500 [/TD]

[TD="bgcolor: #cacaca, align: center"]12
[/TD]
[TD="bgcolor: #00b050"]Completed[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]Delivery[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff, align: right"]8[/TD]
[TD="bgcolor: #00ccff"]TLO-Basic[/TD]
[TD="bgcolor: #00ccff"]*[/TD]

[TD="bgcolor: #00ccff, align: right"]12/2/2011[/TD]
[TD="bgcolor: #00ccff"]Awareness[/TD]

[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]

</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Summary

*BCDEFG
*
*

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:155px;"><col style="width:201px;"><col style="width:73px;"><col style="width:87px;"><col style="width:87px;"><col style="width:87px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]6[/TD]
[TD="bgcolor: #c0c0c0"]*[/TD]
[TD="bgcolor: #c0c0c0, align: center"]Total[/TD]
[TD="bgcolor: #c0c0c0, align: center"]Tution[/TD]
[TD="bgcolor: #c0c0c0"]*[/TD]
[TD="bgcolor: #c0c0c0, align: center"]UASI[/TD]
[TD="bgcolor: #c0c0c0, align: center"]SHGP[/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]
[TD="bgcolor: #ccffcc"]Encumbered[/TD]
[TD="align: right"]$4,500.00[/TD]
[TD="align: right"]$6,700.00[/TD]

[TD="align: right"]$4,500.00[/TD]
[TD="align: right"]$0.00[/TD]

[TD="bgcolor: #cacaca, align: center"]8[/TD]
[TD="bgcolor: #ffff99"]Expended[/TD]
[TD="align: right"]$11,598.31[/TD]
[TD="align: right"]$6,700.00[/TD]

[TD="align: right"]$9,727.19[/TD]
[TD="align: right"]$1,871.12[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
C7{=SUM(IF(Status="Pending",Total))}
D7{=SUM(IF(Status="Pending",Tution))}
F7{=SUM(IF(Status="Pending",OT))}
G7{=SUM(IF(Status="Pending",Backfill))}
C8{=SUM(IF(Status="Completed",Total))}
D8{=SUM(IF(Status="Completed",Tution))}
F8{=SUM(IF(Status="Completed",OT))}
G8{=SUM(IF(Status="Completed",Backfill))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Have you tried adjusting the formula to:
=sumif(status,"Pending",Total)
or =sumif(Range,criteria,sum range).

See if that returns the value you are after.

The other thing to check would be the Range Names, to ensure that they are Equal. IE start in the same row's, end in the same rows, that sort of thing. If the ranges are different it doesn't sum the way it should.

Hope that helps.
 
Upvote 0
Here's what I did and thanks for the help. It's been a while so please treat me as a noob. As you can see I changed the formula and got one of the values correct. Yes the Name Range was off but it's not picking up the right criteria for Pending and Complete.

Encumbered means Pending and Expended means Complete. I didn't write this but tasked to change it.

Thanks again!

Jim

Worksheet

*BCDEFGINOPQRS
MyCity
*Delivery**TLO-AdvanceMyCity*****
*Delivery**TLO-AdvanceMyCity*****

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:69px;"><col style="width:51px;"><col style="width:108px;"><col style="width:49px;"><col style="width:41px;"><col style="width:107px;"><col style="width:89px;"><col style="width:50px;"><col style="width:68px;"><col style="width:84px;"><col style="width:45px;"><col style="width:45px;"><col style="width:53px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]
[TD="bgcolor: #c0c0c0"]Status[/TD]
[TD="bgcolor: #c0c0c0"]Agency[/TD]
[TD="bgcolor: #c0c0c0"]Discipline[/TD]
[TD="bgcolor: #008080"]Trained[/TD]
[TD="bgcolor: #008080"]Hours[/TD]
[TD="bgcolor: #c0c0c0"]Course[/TD]
[TD="bgcolor: #c0c0c0"]Course_Loc[/TD]
[TD="bgcolor: #c0c0c0"]Tuition[/TD]
[TD="bgcolor: #008080, align: center"]Delivery
Cost UASI[/TD]
[TD="bgcolor: #008080, align: center"]Delivery
Cost SHSGP[/TD]
[TD="bgcolor: #008080, align: center"]LE UASI BF/OT[/TD]
[TD="bgcolor: #008080, align: center"]Fire UASI BF/OT[/TD]
[TD="bgcolor: #008080, align: center"]LE SHSGP BF/OT
[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]
[TD="bgcolor: #00b050"]Completed[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]Delivery[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff, align: right"]24[/TD]
[TD="bgcolor: #00ccff"]TLO-Intermediate[/TD]

[TD="bgcolor: #00ccff, align: right"]14,950[/TD]
[TD="bgcolor: #00ccff, align: right"]14,950[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]
[TD="bgcolor: #00ccff"]*[/TD]

[TD="bgcolor: #cacaca, align: center"]23[/TD]
[TD="bgcolor: #ffff00"]Pending[/TD]

[TD="align: right"]6,700 [/TD]

[TD="bgcolor: #cacaca, align: center"]24[/TD]
[TD="bgcolor: #00b050"]Completed[/TD]

[TD="align: right"]6,700 [/TD]

</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Summary

*BCDEFG
*
*

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:155px;"><col style="width:201px;"><col style="width:72px;"><col style="width:87px;"><col style="width:87px;"><col style="width:87px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]6[/TD]
[TD="bgcolor: #c0c0c0"]*[/TD]
[TD="bgcolor: #c0c0c0, align: center"]Total[/TD]
[TD="bgcolor: #c0c0c0, align: center"]Tution[/TD]
[TD="bgcolor: #c0c0c0"]*[/TD]
[TD="bgcolor: #c0c0c0, align: center"]UASI[/TD]
[TD="bgcolor: #c0c0c0, align: center"]SHGP[/TD]

[TD="bgcolor: #cacaca, align: center"]7[/TD]
[TD="bgcolor: #ccffcc"]Encumbered
[/TD]
[TD="align: right"]$4,500.00[/TD]
[TD="align: right"]$0.00[/TD]

[TD="align: right"]$4,500.00[/TD]
[TD="align: right"]$0.00[/TD]

[TD="bgcolor: #cacaca, align: center"]8[/TD]
[TD="bgcolor: #ffff99"]Expended
[/TD]
[TD="align: right"]$11,598.31[/TD]
[TD="align: right"]$14,950.00[/TD]

[TD="align: right"]$9,727.19[/TD]
[TD="align: right"]$1,871.12[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
C7{=SUM(IF(Status="Pending",Total))}
D7=SUMIF(Status,"Pending",Tution)
F7{=SUM(IF(Status="Pending",OT))}
G7{=SUM(IF(Status="Pending",Backfill))}
C8{=SUM(IF(Status="Completed",Total))}
D8=SUMIF(Status,"Completed",Tution)
F8{=SUM(IF(Status="Completed",OT))}
G8{=SUM(IF(Status="Completed",Backfill))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
Problem Solved! Once again it was a name range problem and I thought I had checked them all but didn't

Thanks again for all the help!

Jim
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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