Help

Struggling with nested IF formula

Topic Labels: Formulas
1313 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Julien_Altoe
4 - Data Explorer
4 - Data Explorer

Hi guys,

I’m struggling to get this formula validated, which is odd as it’s been validated by an Excel master…?

IF(
{User status}=“New sign-up no story”,
“Send new sign-up email”,
IF(
{User status}="New sign-up story in new”,
“Send new story email”,
IF(
{User status}=“Sign-up no story”,
“Send sign-up no story email”,
IF(
{User status}="Sign-up Story in new”,
“Send new story email”,
IF(
{User status}=“Sign-up Story in draft”,
“Send story in draft email”,
IF(
{User status}="Sign-up story in published”,
“Send post-publication email”,
“Nothing”
)
)
)
)
)
)

4 Replies 4
Nick_Dennis
7 - App Architect
7 - App Architect

Hi @Julien_Altoe!

I think this is just a text formatting issue with your quotation marks, but your code is fine. The quotations marks look mostly normal here, but when I copy and paste this formula, there are 2 types of quotation marks present. I just went through and replaced them all with standard quotations, and it worked fine for me.

Here’s the reformatted version, if it helps:
IF( {User status}="New sign-up no story", "Send new sign-up email", IF( {User status}="New sign-up story in new", "Send new story email", IF( {User status}="Sign-up no story", "Send sign-up no story email", IF( {User status}="Sign-up Story in new","Send new story email", IF( {User status}="Sign-up Story in draft", "Send story in draft email", IF( {User status}="Sign-up story in published", "Send post-publication email", "Nothing"))))))

Hope that helps. Welcome to the forums.

Brilliant, thanks a lot for the help and the quick turnaround Nick, much appreciated!

FYI You could do this a little cleaner with a single SWITCH() statement instead of several IF()s

SWITCH(
   {User status},

   "New sign-up no story",
   "Send new sign-up email",

   "New sign-up story in new",
   "Send new story email",

   "Sign-up no story",
   "Send sign-up no story email",

   "Sign-up Story in new",
   "Send new story email",

   "Sign-up Story in draft",
   "Send story in draft email",

   "Sign-up story in published",
   "Send post-publication email",

   "Nothing"
)

Yes, I tried as well but obviously didn’t work either due to the wrong brackets.

Now it works, I shall definitely use that interesting SWITCH next time, many thanks!