Forum Discussion

tonyb1986's avatar
tonyb1986
Copper Contributor
Jul 27, 2022
Solved

Multiple IF statement

Hi all,   i am trying to create a calculated column in sharepoint online document library i was hoping to use the following if statement but i cant see where the issue is or why its not working, i ...
  • tonyb1986  

    It looks correct and works for me when I test with the same code. I have sometimes experienced that there can be problems with language settings so you can try replacing the " with ' and see if that helps.


    The statement You are trying to use (that does not work):

    =IF([Document Type]="Form","F-",

    IF([Document Type]="Document","D-",

    IF([Document Type]="SOP","SOP-")))


    The statement i am using (that works for me):

    =IF([Document Type]="Form","F-",IF([Document Type]="Document","D-",IF([Document Type]="SOP","SOP-")))


    A statement that might work for You:
    =IF([Document Type]='Form','F-',IF([Document Type]='Document','D-',IF([Document Type]='SOP','SOP-')))

     

    If that variant doesn't work, maybe you can try removing the line breaks in your code and typing/pasting the code the way I wrote it with everything on one line. (That shouldn't be the solution but you never know 🙂

     

Resources