Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula help

Status
Not open for further replies.

wanzek1

Technical User
Jun 13, 2012
79
US
I need to total a column that has this as a formula:

if (Sum ({vrptJCUnitCostCT;1.CurrEstUnits}, {vrptJCUnitCostCT;1.CostType})+
Sum ({vrptJCUnitCostCT;1.CurrEstCost}, {vrptJCUnitCostCT;1.CostType})+
Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType})) = 0 then 0 else

if Sum ({vrptJCUnitCostCT;1.CurrEstUnits}, {vrptJCUnitCostCT;1.CostType})=0 and
Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType})>Sum ({vrptJCUnitCostCT;1.CurrEstCost}, {vrptJCUnitCostCT;1.CostType}) then
Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType}) else

if Sum ({vrptJCUnitCostCT;1.CurrEstUnits}, {vrptJCUnitCostCT;1.CostType})=0 and
Sum ({vrptJCUnitCostCT;1.CurrEstCost}, {vrptJCUnitCostCT;1.CostType})= 0 and Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType})<0 then
Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType}) else


if Sum ({vrptJCUnitCostCT;1.CurrEstUnits}, {vrptJCUnitCostCT;1.CostType})=0 and
Sum ({vrptJCUnitCostCT;1.CurrEstCost}, {vrptJCUnitCostCT;1.CostType})>=Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType}) then
Sum ({vrptJCUnitCostCT;1.CurrEstCost}, {vrptJCUnitCostCT;1.CostType}) else


if Sum ({vrptJCUnitCostCT;1.CurrEstUnits}, {vrptJCUnitCostCT;1.CostType})<>0 and Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType})<>0 and
Sum ({vrptJCUnitCostCT;1.ActualUnits}, {vrptJCUnitCostCT;1.CostType})<>0
then
(if Sum ({vrptJCUnitCostCT;1.ActualUnits}, {vrptJCUnitCostCT;1.CostType})>Sum ({vrptJCUnitCostCT;1.CurrEstUnits}, {vrptJCUnitCostCT;1.CostType}) then
((Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType})/Sum ({vrptJCUnitCostCT;1.ActualUnits}, {vrptJCUnitCostCT;1.CostType}))*Sum ({vrptJCUnitCostCT;1.ActualUnits}, {vrptJCUnitCostCT;1.CostType})) else
((Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType})/Sum ({vrptJCUnitCostCT;1.ActualUnits}, {vrptJCUnitCostCT;1.CostType}))*Sum ({vrptJCUnitCostCT;1.CurrEstUnits}, {vrptJCUnitCostCT;1.CostType})))
else
if Sum ({vrptJCUnitCostCT;1.CurrEstCost}, {vrptJCUnitCostCT;1.CostType})>Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType}) then Sum ({vrptJCUnitCostCT;1.CurrEstCost}, {vrptJCUnitCostCT;1.CostType}) else
Sum ({vrptJCUnitCostCT;1.ActualCost}, {vrptJCUnitCostCT;1.CostType})

There has got to be a way but I can't get it to work. It has to be a total per a subgroup.

The levels of grouping are:
Company
Contract
Job
Subgroup
CostType
Phase

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top