Forum Discussion

BlancaAnderson's avatar
BlancaAnderson
Qrew Assistant Captain
6 years ago

Average these only if this

I need help with this formula.

I need the average of certain numbers for a certain apartment unit, so I currently have this formula:

Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors],[Flooring],[Demo],[Kitchen Cabinets],[Kitchen Countertops],[Paint],[Door Hardware],[Tub Completion %])

My dilema is that not all apartment units need tubs, so I would like the formula to say if the property is named "Paradise Hills" then the average would only be for certain tasks.

Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors],[Flooring],[Demo],[Kitchen Cabinets],[Kitchen Countertops],[Paint],[Door Hardware])

Makes sense?

I know I would essentially need to keep changing my formula or adding every project to it but I'm okay with that.  

Please help!  I don't have time to research it on my own this time.
  • try this

    IF([Project Name] <> "Paradise Hills",

    Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors],[Flooring],[Demo],[Kitchen Cabinets],[Kitchen Countertops],[Paint],[Door Hardware],[Tub Completion %]),

    Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors],[Flooring],[Demo],[Kitchen Cabinets],[Kitchen Countertops],[Paint],[Door Hardware])
    )
  • BlancaAnderson's avatar
    BlancaAnderson
    Qrew Assistant Captain
    THAT WORKED!!!  I have a follow up question.  Just in case.  Let's say I have two projects that are different from the rest.  How would i do if project paradise hills 1, average this, if paradise hills 2, average this other, otherwise this.

    Here is my attempt:  Is this correct?


    IF([Project Name] <> "Paradise Hills1",

    Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors],[Flooring]),

    IF([Project Name] <> "Paradise Hills2",

    Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors]),

    Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors],[Flooring],[Demo],[Kitchen Cabinets],[Kitchen Countertops],[Paint],[Door Hardware])
    )
  • Close but too complicated.  You just need 1 IF

    IF([Project Name] = "Paradise Hills1",
    Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors],[Flooring]),

    [Project Name] =  "Paradise Hills2",
    Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors]),

    Average([Appliances],[Bath Cabinets],[Bath Countertops],[Doors],[Flooring],[Demo],[Kitchen Cabinets],[Kitchen Countertops],[Paint],[Door Hardware])
    )