Hi,
I'm trying to figure out why this nested if is giving me a false:
It's supposed to return a 2.
When I break the code into two pieces, it works.
Working Code that returns a 2:
I'm trying to add the above code to this code and combine:
When I try to combine the two, that's when I get the false. Any thoughts?
Thanks!
I'm trying to figure out why this nested if is giving me a false:
Code:
=IF(OR(F3="Y",AN3<=6),AQ3,IF(AND(O3="N",SEARCH("Open",D3),AQ3>=3),AQ3,IF(AND(SEARCH("Open",D3),O3="N"),IF(OR(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)>=3,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)>=3,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)>=3,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)>=3,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)>=3,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)))>Details!AR3)),3,IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)>=2,VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)<3,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)>=2,VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)<3,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)>=2,VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)<3,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)>=2,VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)<3,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)>=2,VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)<3,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE),IF(AND(O3="Y",SEARCH("Open",D3),AQ3>=2),AQ3,IF(AND(SEARCH("Open",D3),O3="Y"),IF(OR(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)))>Details!AR3)),2,IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE))))))))))))))))))
It's supposed to return a 2.
When I break the code into two pieces, it works.
Working Code that returns a 2:
Code:
=IF(AND(SEARCH("Open",D3),O3="Y"),IF(OR(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)))>Details!AR3),AND(VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)>=2,(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)))>Details!AR3)),2,IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:B,2,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:C,3,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:D,4,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:E,5,FALSE),IF(AND(VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)>=1,VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)<2,ROUNDDOWN(365/((AN3*AQ3)/VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE)),0)>ROUNDDOWN(AR3,0)),VLOOKUP(A3,'WOs (DSP Only)'!A:F,6,FALSE))))))))
I'm trying to add the above code to this code and combine:
Code:
=IF(OR(F2="Y",AN2<=6),AQ2,IF(AND(O2="N",SEARCH("Open",D2),AQ2>=3),AQ2,IF(AND(O2="Y",SEARCH("Open",D2),AQ2>=2),AQ2,IF(AND(SEARCH("Open",D2),O2="N"),IF(OR(AND(VLOOKUP(A2,'WOs (DSP Only)'!A:B,2,FALSE)>=3,(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:B,2,FALSE)))>Details!AR2),AND(VLOOKUP(A2,'WOs (DSP Only)'!A:C,3,FALSE)>=3,(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:C,3,FALSE)))>Details!AR2),AND(VLOOKUP(A2,'WOs (DSP Only)'!A:D,4,FALSE)>=3,(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:D,4,FALSE)))>Details!AR2),AND(VLOOKUP(A2,'WOs (DSP Only)'!A:E,5,FALSE)>=3,(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:E,5,FALSE)))>Details!AR2),AND(VLOOKUP(A2,'WOs (DSP Only)'!A:F,6,FALSE)>=3,(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:F,6,FALSE)))>Details!AR2)),3,IF(AND(VLOOKUP(A2,'WOs (DSP Only)'!A:B,2,FALSE)>=2,VLOOKUP(A2,'WOs (DSP Only)'!A:B,2,FALSE)<3,ROUNDDOWN(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:B,2,FALSE)),0)>ROUNDDOWN(AR2,0)),VLOOKUP(A2,'WOs (DSP Only)'!A:B,2,FALSE),IF(AND(VLOOKUP(A2,'WOs (DSP Only)'!A:C,3,FALSE)>=2,VLOOKUP(A2,'WOs (DSP Only)'!A:C,3,FALSE)<3,ROUNDDOWN(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:C,3,FALSE)),0)>ROUNDDOWN(AR2,0)),VLOOKUP(A2,'WOs (DSP Only)'!A:C,3,FALSE),IF(AND(VLOOKUP(A2,'WOs (DSP Only)'!A:D,4,FALSE)>=2,VLOOKUP(A2,'WOs (DSP Only)'!A:D,4,FALSE)<3,ROUNDDOWN(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:D,4,FALSE)),0)>ROUNDDOWN(AR2,0)),VLOOKUP(A2,'WOs (DSP Only)'!A:D,4,FALSE),IF(AND(VLOOKUP(A2,'WOs (DSP Only)'!A:E,5,FALSE)>=2,VLOOKUP(A2,'WOs (DSP Only)'!A:E,5,FALSE)<3,ROUNDDOWN(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:E,5,FALSE)),0)>ROUNDDOWN(AR2,0)),VLOOKUP(A2,'WOs (DSP Only)'!A:E,5,FALSE),IF(AND(VLOOKUP(A2,'WOs (DSP Only)'!A:F,6,FALSE)>=2,VLOOKUP(A2,'WOs (DSP Only)'!A:F,6,FALSE)<3,ROUNDDOWN(365/((AN2*AQ2)/VLOOKUP(A2,'WOs (DSP Only)'!A:F,6,FALSE)),0)>ROUNDDOWN(AR2,0)),VLOOKUP(A2,'WOs (DSP Only)'!A:F,6,FALSE),2))))))))))
When I try to combine the two, that's when I get the false. Any thoughts?
Thanks!