sharepoint nested if and statement syntax help

%3CLINGO-SUB%20id%3D%22lingo-sub-2281429%22%20slang%3D%22en-US%22%3Esharepoint%20nested%20if%20and%20statement%20syntax%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2281429%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20nested%20IF%20AND%20statement%2C%20but%20i%20think%20i%20may%20be%20wrong%20with%20the%20brackets.%3C%2FP%3E%3CP%3ECan%20i%20ask%20that%20someone%20casts%20their%20eye%20over%20please.%3C%2FP%3E%3CP%3EI%20am%20not%20sure%20if%20i%20need%20closing%20brackets%20in%20each%20condition.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20time%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(AND(%5BPayment%20Method%5D%3D%22PPT%20-%20Partial%22%2C%5BCopy%20Docs%20emailed%20for%20approval%5D%26lt%3B%3D%5BDespatch%20Target.%5D%2C%22On%20Time%22%2C%20IF(AND(%5BPayment%20Method%5D%3D%22OAC%22%2C%5BDespatch%20Date%20of%20Original%20Docs%5D%26lt%3B%3D%5BDespatch%20Target.%5D%2C%22On%20Time%22%2C%20IF(AND(%5BPayment%20Method%5D%3D%22DOC%22%2C%5BDespatch%20Date%20of%20Original%20Docs%5D%26lt%3B%3D%5BDespatch%20Target.%5D%2C%22On%20Time%22%2CIF(AND(%5BPayment%20Method%5D%3D%22LOC%22%2C%5BDespatch%20Date%20of%20Original%20Docs%5D%26lt%3B%3D%5BDespatch%20Target.%5D%2C%22On%20Time%22%2C%22Late%22)))))%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2281429%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2282469%22%20slang%3D%22en-US%22%3ERe%3A%20sharepoint%20nested%20if%20and%20statement%20syntax%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2282469%22%20slang%3D%22en-US%22%3EYes%20i%20managed%20to%20get%20it%20working%20this%20morning%2C%20just%20didn't%20get%20a%20chance%20to%20update%20the%20thread.%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F373269%22%20target%3D%22_blank%22%3E%40ganeshsanap%3C%2FA%3E%20for%20taking%20the%20time%20to%20answer%2C%20given%20there%20has%20been%20over%20100%20views.%3CBR%20%2F%3EMuch%20appreciated.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2282417%22%20slang%3D%22en-US%22%3ERe%3A%20sharepoint%20nested%20if%20and%20statement%20syntax%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2282417%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1005248%22%20target%3D%22_blank%22%3E%40mogornua1%3C%2FA%3E%26nbsp%3BYou%20were%20missing%20some%20closing%20brackets.%20Here's%20the%20corrected%20formula%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-javascript%22%3E%3CCODE%3E%3DIF(AND(%5BPayment%20Method%5D%20%3D%20%22PPT%20-%20Partial%22%2C%20%5BCopy%20Docs%20emailed%20for%20approval%5D%20%26lt%3B%3D%20%5BDespatch%20Target.%5D)%2C%20%22On%20Time%22%2C%20IF(AND(%5BPayment%20Method%5D%20%3D%20%22OAC%22%2C%20%5BDespatch%20Date%20of%20Original%20Docs%5D%20%26lt%3B%3D%20%5BDespatch%20Target.%5D)%2C%20%22On%20Time%22%2C%20IF(AND(%5BPayment%20Method%5D%20%3D%20%22DOC%22%2C%20%5BDespatch%20Date%20of%20Original%20Docs%5D%20%26lt%3B%3D%20%5BDespatch%20Target.%5D)%2C%20%22On%20Time%22%2C%20IF(AND(%5BPayment%20Method%5D%20%3D%20%22LOC%22%2C%20%5BDespatch%20Date%20of%20Original%20Docs%5D%20%26lt%3B%3D%20%5BDespatch%20Target.%5D)%2C%20%22On%20Time%22%2C%20%22Late%22))))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CHR%20%2F%3E%3CP%3EPlease%20click%26nbsp%3B%3CSTRONG%3EMark%20as%20Best%20Response%3C%2FSTRONG%3E%26nbsp%3B%26amp%3B%20%3CSTRONG%3ELike%3C%2FSTRONG%3E%20if%20my%20post%20helped%20you%20to%20solve%20your%20issue.%20This%20will%20help%20others%20to%20find%20the%20correct%20solution%20easily.%20It%20also%20closes%20the%20item.%20If%20the%20post%20was%20useful%20in%20other%20ways%2C%20please%20consider%20giving%20it%20%3CSTRONG%3ELike%3C%2FSTRONG%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2281557%22%20slang%3D%22en-US%22%3ERe%3A%20sharepoint%20nested%20if%20and%20statement%20syntax%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2281557%22%20slang%3D%22en-US%22%3ECan%20anyone%20confirm%20if%20this%20is%20the%20correct%20way%20to%20do%20IF%20AND%20in%20a%20SharePoint%20calculated%20column%3F%3CBR%20%2F%3EThank%20you%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello,

 

I have a nested IF AND statement, but i think i may be wrong with the brackets.

Can i ask that someone casts their eye over please.

I am not sure if i need closing brackets in each condition.

 

Thank you for your time

 

=IF(AND([Payment Method]="PPT - Partial",[Copy Docs emailed for approval]<=[Despatch Target.],"On Time", IF(AND([Payment Method]="OAC",[Despatch Date of Original Docs]<=[Despatch Target.],"On Time", IF(AND([Payment Method]="DOC",[Despatch Date of Original Docs]<=[Despatch Target.],"On Time",IF(AND([Payment Method]="LOC",[Despatch Date of Original Docs]<=[Despatch Target.],"On Time","Late")))))

3 Replies
Can anyone confirm if this is the correct way to do IF AND in a SharePoint calculated column?
Thank you

@DairyG1 You were missing some closing brackets. Here's the corrected formula:

 

=IF(AND([Payment Method] = "PPT - Partial", [Copy Docs emailed for approval] <= [Despatch Target.]), "On Time", IF(AND([Payment Method] = "OAC", [Despatch Date of Original Docs] <= [Despatch Target.]), "On Time", IF(AND([Payment Method] = "DOC", [Despatch Date of Original Docs] <= [Despatch Target.]), "On Time", IF(AND([Payment Method] = "LOC", [Despatch Date of Original Docs] <= [Despatch Target.]), "On Time", "Late"))))

 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

Yes i managed to get it working this morning, just didn't get a chance to update the thread.

Thank you @ganeshsanap for taking the time to answer, given there has been over 100 views.
Much appreciated.