More fun with functions =IF(OR

Options

So, I am trying to set up a formula that assigns a person based on a teaching discipline. I have had some success, however, only when it comes to 1-to-1 relationships. I would like to assign an individual name based on any of several possible teaching disciplines within their purview. So, what I have that currently works looks like this:

=IF([Teaching Discipline]@row = "English", "AA", IF([Teaching Discipline]@row = "Art", "BB", IF([Teaching Discipline]@row = "Philosophy", "CC", IF([Teaching Discipline]@row = "Business", "DD", IF([Teaching Discipline]@row = "Accounting", "EE", IF([Teaching Discipline]@row = "Government", "FF", IF([Teaching Discipline]@row = "History", "GG", IF([Teaching Discipline]@row = "Anthropology", "HH", IF([Teaching Discipline]@row = "Mathematics", "II", IF([Teaching Discipline]@row = "Biology", "JJ", IF([Teaching Discipline]@row = "Geology", "KK", IF([Teaching Discipline]@row = "Computer Science", "LL"))))))))))))

I'd like to expand the above formula so that "AA" might populate in the name column not based on just "English" in the Teaching Discipline, but also "Humanities." So that either of those disciplines might trigger "AA" to appear in the name column on the same row. Likewise, I'd like to add additional disciplines for other names like "BB," "CC," and so on.

I expect this would involve some OR functions being added, but I've yet to be able to put something together that doesn't trigger an UNPARSEABLE or some other error.

Thanks for any insight.

Tags:

Best Answer

  • DKazatsky2
    DKazatsky2 ✭✭✭✭✭
    Answer ✓
    Options

    Hi @Draykov ,

    I have added in the OR syntax for "Humanities" as in your example.

    =IF(OR([Teaching Discipline]@row = "English", [Teaching Discipline]@row = "Humanities"), "AA", IF([Teaching Discipline]@row = "Art", "BB", IF([Teaching Discipline]@row = "Philosophy", "CC", IF([Teaching Discipline]@row = "Business", "DD", IF([Teaching Discipline]@row = "Accounting", "EE", IF([Teaching Discipline]@row = "Government", "FF", IF([Teaching Discipline]@row = "History", "GG", IF([Teaching Discipline]@row = "Anthropology", "HH", IF([Teaching Discipline]@row = "Mathematics", "II", IF([Teaching Discipline]@row = "Biology", "JJ", IF([Teaching Discipline]@row = "Geology", "KK", IF([Teaching Discipline]@row = "Computer Science", "LL"))))))))))))

    If you follow the same structure, you can add to any of the other IF scenarios you need.

    Hope this helps,

    Dave

Answers

  • DKazatsky2
    DKazatsky2 ✭✭✭✭✭
    Answer ✓
    Options

    Hi @Draykov ,

    I have added in the OR syntax for "Humanities" as in your example.

    =IF(OR([Teaching Discipline]@row = "English", [Teaching Discipline]@row = "Humanities"), "AA", IF([Teaching Discipline]@row = "Art", "BB", IF([Teaching Discipline]@row = "Philosophy", "CC", IF([Teaching Discipline]@row = "Business", "DD", IF([Teaching Discipline]@row = "Accounting", "EE", IF([Teaching Discipline]@row = "Government", "FF", IF([Teaching Discipline]@row = "History", "GG", IF([Teaching Discipline]@row = "Anthropology", "HH", IF([Teaching Discipline]@row = "Mathematics", "II", IF([Teaching Discipline]@row = "Biology", "JJ", IF([Teaching Discipline]@row = "Geology", "KK", IF([Teaching Discipline]@row = "Computer Science", "LL"))))))))))))

    If you follow the same structure, you can add to any of the other IF scenarios you need.

    Hope this helps,

    Dave

  • Draykov
    Draykov ✭✭✭✭
    Options

    Thanks @DKazatsky2! That syntax did the trick and I was able to finish out my formula successfully! I appreciate the help!