Having trouble with multiple IF statement

Copper Contributor

Ok, so I have three columns: 

 

PO Required By (calculated date column)      Date Needed to Ship         Leadtime

 

The first IF statement works fine if both Date Needed to Ship   and    Leadtime  have the NA value selected.    The result shows NA in the PO Required By column.  

 

The problem is that I need another IF statement (or maybe two more) that allows for Leadtime or Date Needed to Ship to have a value other than NA, but still allow PO Required By to say NA.    The reason for this is that our shipping team may know the Leadtime for production, but still not yet know when our client wants something to ship.   So they may put the Leadtime value in, but the Date Needed to Ship will still be blank (or vice versa).   In this case, the PO Required By should needs to still show NA.  

 

ONLY when both the Date Needed to Ship, and the Leadtime have values, should the calculated column perform the math:    Date Needed to Ship minus Leadtime.     This gives a date value in the PO Required by Column.   

 

Here is what I have so far but I always get a syntax error.   Please help!

 

=IF(AND([Date Needed to Ship]="NA",OR(Leadtime="NA",)),"NA","NA"),IF(AND([Date Needed to Ship]<>"NA",AND(Leadtime<>"NA",)),[Date Needed to Ship]-Leadtime),"NA"))

0 Replies