title: Excel Error Trace IF nested statements
body: <p>Am trying to trace back an error on a spreadsheet, but am having difficulties tracing it. Here is the code that is present on the cell:</p>
  
  <pre><code>=IF($A$4="","N/A",
  IF(OR('Manual Input'!$I$6="ENTER ENGAGEMENT LETTER DATE 
  (YYYY/MM/DD)",'Manual Input'!$I$6=""),"SEE REVIEW PERIOD START DATE",
  IF(AF4="No",
  IF(AND(
  IF(AND(TRIM(I4)&lt;&gt;"NA",TRIM(I4)&lt;&gt;"N/A",TRIM(I4&lt;&gt;"None"),
  MAX(IF(ISTEXT(I4),DATEVALUE(TRIM(I4)),I4),IF(ISTEXT(G4),DATEVALUE(TRI
  M(G4)),G4))&gt;($AQ$1-365),IF(ISTEXT(G4),DATEVALUE(TRIM(G4)),G4)&gt;($AQ$1-365)),
  IF(ISTEXT(G4),DATEVALUE(TRIM(G4)),G4)
  &lt;=IF(ISTEXT(T4),DATEVALUE(TRIM(T4)),T4),TRIM(T4),
  IF(AND(TRIM(I4)&lt;&gt;"NA",TRIM(I4)&lt;&gt;"N/A",TRIM(I4)
  &lt;&gt;"None"),IF(ISTEXT(I4),DATEVALUE(TRIM(I4)),I4)
  &lt;=IF(ISTEXT(T4),DATEVALUE(TRIM(T4)),T4),
  OR(TRIM(I4)="NA",TRIM(I4)="N/A",TRIM(I4)="None")),
  IF(ISTEXT(G4),DATEVALUE(TRIM(G4)),G4)&lt;=IF(AND(TRIM(U4)&lt;&gt;"NA",TRIM(U4)
  &lt;&gt;"N/A"),IF(ISTEXT(U4),DATEVALUE(TRIM(U4)),U4),TRIM(U4)),
  IF(ISTEXT(G4),DATEVALUE(TRIM(G4)),G4)&lt;=IF(AND(TRIM(V4)&lt;&gt;"NA",TRIM(V4)
  &lt;&gt;"N/A"),IF(ISTEXT(V4),DATEVALUE(TRIM(V4)),V4),TRIM(V4)),
  IF(ISTEXT(G4),DATEVALUE(TRIM(G4)),G4)&lt;=IF(AND(TRIM(W4)&lt;&gt;"NA",TRIM(W4)
  &lt;&gt;"N/A"),IF(ISTEXT(W4),DATEVALUE(TRIM(W4)),W4),TRIM(W4))),
  "Yes","No"),"INVALID VALUES")))
  </code></pre>
  
  <p>I keep getting a value error. I tried running the Evaluate formula and the following is the sequence before the error happens:</p>
  
  <pre><code>IF(FALSE, #N/A, IF(FALSE, #N/A, IF(TRUE, IF(AND(TRUE, TRUE, "2017/04/24", 
  TRUE, TRUE, TRUE, TRUE), "Yes, "No"), "Invalid")))
  </code></pre>
  
  <p>I know that the date is supposed to be a True/False, but am not sure how to correct it. Any help would be good.
  Data:
  I4 = NA,    G4 = 2017/4/20,   AQ1 = 2017/03/01
  T4=2017/4/24,    U4=2017/4/26,    V4=NA </p>
  
  <p>Additionally, on clicking error checking, it states that "The value used on the formula is of wrong data type"</p>