Discussions

Expand all | Collapse all

Formula Syntax Error

  • 1.  Formula Syntax Error

    Posted 01-22-2018 20:13
    I keep getting a syntax error for the current formula. Any ideas what I am missing?

    If([Measure]="M&V" or [Measure]="Modeled" or [Measure]="Post measurement",  
    If([PercentChange1]=0 and [PercentChange2]=0 and [PercentChange3]=0 and [PercentChange4]=0,
    If([SavingsCalcVersion]= "2016" and [Customer - Utility]="ABC",    
    If(Contains([Equipment - BuildingType],"amily"),0.117,0.083),    
    If([BlowerCleaned]=true and [EvaporatorCleaned]=true,      
    If([Customer - State]="TX" or [Customer - State]="NM",0.11,0.109),      
    If([Customer - State]="TX" or [Customer - State]="NM",0.093,0.095))))),    
    If([SavingsCalcVersion]= "2017" and [Customer - Utility]="ABC",    
    If(Contains([Equipment - BuildingType],"amily"),0.136,    
    If([Equipment - NominalTonnage]<25,0.1,0.081)),    
    If([Customer - State]="TX" or [Customer - State]="NM",      
    If(Contains([Equipment - BuildingType],"amily"),0.083,0.07),    
    If([BlowerCleaned]=true and [EvaporatorCleaned]=true,0.101,0.087))),    
    If([SavingsCalcVersion]="2018" and [Customer - Utility]="ABC",   
    If(Contains([Equipment - BuildingType],"amily"),0.136,    
    If([Equipment - NominalTonnage]<25,0.1,0.081)),    
    If([Customer - State]="TX" or [Customer - State]="NM",      
    If(Contains([Equipment - BuildingType],"amily"),0.0483,0.0848),    
    If(Contains([Equipment - BuildingType], "amily"),0.0639,0.0866))),    
    If([SavingsCalcVersion]= "2016" and [Customer - Utility]="ABC",    
    If(Contains([Equipment - BuildingType],"amily"),0.192,0.15),        
    If([BlowerCleaned]=true and [EvaporatorCleaned]=true,          
    If([Customer - State]="TX" or [Customer - State]="NM",0.149,0.154),      
    If([Customer - State]="TX" or [Customer - State]="NM",0.12,0.112))),    
    If([SavingsCalcVersion]= "2017" and [Customer - Utility]="ABC",    
    If(Contains([Equipment - BuildingType],"amily"),0.184,    
    If([Equipment - NominalTonnage]<25,0.139,0.105)),    
    If([Customer - State]="TX" or [Customer - State]="NM",      
    If(Contains([Equipment - BuildingType],"amily"),0.148,0.147),      
    If([BlowerCleaned]=true and [EvaporatorCleaned]=true,0.146,0.107))),    
    If([SavingsCalcVersion]="2018" and [Customer - Utility]="ABC",    
    If(Contains([Equipment - BuildingType],"amily"),0.184,    
    If([Equipment - NominalTonnage]<25,0.139,0.105)),    
    If([Customer - State]="TX" or [Customer - State]="NM",      
    If(Contains([Equipment - BuildingType],"amily"),0.1212,0.1117),      
    If(Contains([Equipment - BuildingType],"amily"),0.1383,0.1221)))


  • 2.  RE: Formula Syntax Error

    Posted 01-22-2018 20:39
    You are missing about 20 closing brackets.

    Quick Base, unlike Excel, does not need all those IFs.  Normally you just need 1.  That way you do not have to go cross eyed in matching them up.

    But also the logic ion your formula does not make sense.

    If suggest that you rewrite it like this

    IF(
    some condition is true, result 1,
    some other condition is true, result 2,
    Yet another condition is true, Result 3, Result 4)


  • 3.  RE: Formula Syntax Error

    Posted 01-23-2018 21:20
    I rewrote the script, and it is now working. YEAH!!