# Using IF statements to apply an email address depending on teacher name

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”, ”[email protected]”,
IF(D2 = ”Billie Eilish”, ”[email protected]”,
IF(D2 = ”Jay Cutler”, ”[email protected]”,“”)))
``````

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

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", "[email protected]",
IF(D2 = "Billie Eilish", "[email protected]",
IF(D2 = "Jay Cutler", "[email protected]","")))
``````

# Straight `" "` VS curly `“ ”`

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.

• Aha! Thank you so much. Commented Sep 16, 2019 at 23:24
• I am attempting to do this for 50+ names. Would I be able to do it in an editor such as Atom and copy paste it into the sheet? Commented Sep 16, 2019 at 23:32
• Yes you would. Atom is a source code editor so you would not have any issues. In any case just rty it on just one name and `Copy-Paste` to find out. Commented Sep 16, 2019 at 23:37
• Oh it worked right away. You called it as well. Google Docs was what I was using. I'm a bit new to all of this so I very much appreciate the help. Commented Sep 16, 2019 at 23:42