Forum Discussion

StephenAnguiano's avatar
StephenAnguiano
Qrew Cadet
7 years ago

Help with formula

My requirements were the following:

Program = Residential

Measure = M&V and any of these:

M&V_allclean = No

TO_CalculatedCFMPerTon < 340

TO_CalculatedCFMPerTon > 460

If Equipment ? MeteringDevice = TXV and TO_Subcooling > TO_SubcoolingTarget plus 5

If Equipment ? MeteringDevice = TXV and TO_Subcooling < TO_SubcoolingTarget minus 5

If Equipment ? MeteringDevice does not equal TXV and TO_Superheat > TO_TargetSuperHeat plus 5

If Equipment ? MeteringDevice does not equal TXV and TO_Superheat < TO_TargetSuperHeat minus 5

Below is what I came up with and it's not working.

If([Customer - Program]="Residential" and
[Measure]="M&V" and
[M&V_allclean]=false and
[TO_CalculatedCFMPerTon]<340 and
[TO_CalculatedCFMPerTon]>460 and
[Equipment - MeteringDevice]="TXV" and ([TO_Subcooling]>[TO_SubcoolingTarget] + 5 or [TO_Subcooling]<[TO_SubcoolingTarget] - 5) and
[Equipment - MeteringDevice]<>"TXV" and ([TO_Superheat]>[TO_TargetSuperHeat] + 5 or [TO_Superheat]<[TO_TargetSuperHeat] - 5), "140")

Thanks for any assistance.

2 Replies

  • Group your conditions in parenthesis.

    If( (condition 1) and (condition 2and (condition 3), true result, false result)
  • Hi Stephen
    If you make a formula numeric field, the formula editor will help you with the placement of parenthesis. If you write it out your conditions first like 'this AND this AND This OR This' it helps you make sense of all the fields involved:

    If(
        ([Customer - Program]="Residential") and 
        ([Measure]="M&V") and 
        ([M&V_allclean]= "false") 
    and 
        ([TO_CalculatedCFMPerTon]<340) or ([TO_CalculatedCFMPerTon]>460)
    and 
        ([Equipment - MeteringDevice]="TXV") and 
        ([TO_Subcooling] > ([TO_SubcoolingTarget] + 5) or 
        ([TO_Subcooling] < ([TO_SubcoolingTarget] - 5))) 
    or
        ([Equipment - MeteringDevice]<>"TXV" ) and 
        ([TO_Superheat] > ([TO_TargetSuperHeat] + 5) or 
        ([TO_Superheat] < ([TO_TargetSuperHeat] - 5))), 140)