Search code examples
excelvbaairtable

Worksheet IF statements with AirTable


Im using Airtable (Online Excel Equivalent with their own similar Formulas)but I can't seem to get this to work properly.

So I have three values (UE, PE, EE) which are being used for the following columns (GradeF, ZipcodeF, SchoolF) The formula will be applied to the column "Eligible". So overall what I'm trying to do is If Grade is "UE", then mark as "UE". If Grade is "PE" then determine If Zipcode is "EE" or "PE", or School is "EE", or "PE" if so then mark as "PE" otherwise "UE". If Grade is "EE" then determine If Zipcode is "EE", or School is "EE" if so then mark as "EE" otherwise "UE".

IF(GradeF = "UE", "UE", IF(GradeF = "PE", IF(OR(ZipcodeF = "EE", ZipcodeF = "PE", SchoolF = "EE", SchoolF = "PE"), "PE","UE", IF(GradeF = "EE", IF(OR(ZipcodeF = "EE", SchoolF = "EE"), "EE", "UE" ,"")))))

Solution

  • It's easier if you work backward from your most common case ("UE"). I've never used Airtable, but this should be the logic (line breaks for clarity):

    IF(AND(GradeF="EE",OR(ZipcodeF="EE",SchoolF="EE")),"EE",
    IF(AND(GradeF="PE",OR(ZipcodeF="EE",SchoolF="EE",
    ZipcodeF="PE",SchoolF="PE")),"PE","UE"))