Multiple IF Formula

Occasional Contributor


Below is my full if formula, for now Im just testing this one:

=IF([HOTEL]="CVS - Centralværkstedet","","Test")

Pretty basic, but it is not working.


Error message:


" Sorry, something went wrong

The formula contains a syntax error or is not supported."




=IF([HOTEL]="CVS - Centralværkstedet","",
IF([HOTEL]="CBO - Borupgaard","",
IF([HOTEL]="CCP - Copenhagen Portside","",
IF([HOTEL]="CHC - HC Andersen Odense","",
IF([HOTEL]="CHO - Holte","",
IF([HOTEL]="CAL - Hvide Hus Aalborg","",
IF([HOTEL]="CKP - Kellers Park","",
IF([HOTEL]="CKL - Klarskovgaard","",
IF([HOTEL]="CKO - Kolding","",
IF([HOTEL]="CKG - Kongerbrogaarden","",
IF([HOTEL]="CKS - Køge Strand","",
IF([HOTEL]="CMI - Middelfart","",
IF([HOTEL]="CRE - Rebild Bakker","info@t.dkm",
IF([HOTEL]="CRO - Roskilde","",
IF([HOTEL]="CSO - Sorø","",
IF([HOTEL]="CAA - Aarhus",""))))))))))))))))


8 Replies


I think you simply nested too many IFs. Isn't 7 the maximum?


What kind of column is [HOTEL] ? Text, Choice, Lookup?

While I couldn't figure out the exact issue, I received the same error when I copy/paste your test formula. I erased it and started building it one element at a time. I started with


and substitute one string at a time, testing between each change. I ended up with

=IF([HOTEL]="CVS - Centralværkstedet","","Test")

which works. It looks the same, but something is different. (I suspect a hidden invalid character.) Just keep building the formula piece by piece. It's slow and frustrating sometimes, but without a better error message from SharePoint, there is not much else you can do. It will either work, or you will find the exact change that is causing the issue.

If this helps, please consider marking it as the solution. Thanks and good luck!



I am trying one single line.
Does it work for you if you try with letters/alphabeth?
@Bernd71 also has a valid point for the full formula.

has the following statement:

Nesting level limits A formula can contain up to eight levels of nested functions.

It doesn't explain the issue in the test formula, but you will need to make changes based on number of nested formulas. It will take multiple calculated fields to reach the final result.
Basic approach I would take is maximize the nesting in the first calculated column, with the final result being either the custom result from one of the nested IFs, or the original HOTEL if none match. Then in the next calculated column, the initial IF will test IF [Calc1]=[HOTEL]. If they match, add additional IFs. If they don't match, return the value of Calc1.
Yes, I showed the formula that is working for me. It looks identical to your formula, but I also get the same error if I just copy/paste your formula. I think there is a hidden character causing the error, but rather than troubleshoot that, just recreate the formula one piece at a time, which will hopefully bypass the bad character.
Sadly this nesting limit is not good for me.

I am now trying to use lookup columns instead. But I need Power Automate to Insert the Microsoft Form entry into that lookup-column. That is also an issue now.

Thanks for your help.



Jesus, what an annoying limitation :(

The solution was actually like this.