Help with formula

  • 0
  • 1
  • Question
  • Updated 7 months ago
  • In Progress
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.
Photo of Stephen Anguiano

Stephen Anguiano

  • 394 Points 250 badge 2x thumb

Posted 7 months ago

  • 0
  • 1
Photo of Scott

Scott

  • 314 Points 250 badge 2x thumb
Group your conditions in parenthesis.

If( (condition 1) and (condition 2and (condition 3), true result, false result)
Photo of Lisa

Lisa

  • 210 Points 100 badge 2x thumb
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)