Google-sheets – Using IF statements to apply an email address depending on teacher name

form-muleg-suite-educationgoogle sheetsgoogle-forms

I am attempting to create a sign in sheet for students when they are sent to a "calming" room. The idea is that when they reach the room, they enter their name and select their teacher's name from a drop down list.

I am using Form-mule to automatically send an email to the teacher the student selected saying that they checked into the calming room. However, Form-mule only allows you to set up 15 templates and as we have more than 15 teachers and I cannot expect a 3rd grader to be able to remember their teachers email address, I was hoping I could create a nested IF statement which will compare the teachers name the student selected and to enter an email address in a separate column of the Google Sheet.

The formula I have been using is:

=IF(D2 = “Mrs.Winehouse”, ”mwinehouse@aurorak12.org”, 
IF(D2 = ”Billie Eilish”, ”biellish@aurorak12.org”, 
IF(D2 = ”Jay Cutler”, ”jcutler@aurorak12.org”,“”)))

D2 is the row of the Google Sheet where the Teacher Name info populates.
Unfortunately, I keep receiving a parse error.

Best Answer

Your formula is correct except you should be using straight double quotes (" ") instead of curly double (“ ”) quotes.

This means your formula should be:

=IF(D2 = "Mrs.Winehouse", "mwinehouse@aurorak12.org", 
   IF(D2 = "Billie Eilish", "biellish@aurorak12.org", 
       IF(D2 = "Jay Cutler", "jcutler@aurorak12.org","")))

Straight " " VS curly “ ”

Please read more about quotes on straight and curly quotes.
Curly quotes are also reffered as smart quotes.

You most likely created the formula in a program like Microsoft Word or an app like Google Docs and then copied it on to the cell.
When creating a formula, create it within a cell by double clicking on it.

I did not edit your post so you can compare the difference.