Strange If And Or issue

kltinaheart

New Member
Joined
Apr 20, 2018
Messages
14
Hey all,
getting N/A errors for some reason.

Code:
[FONT=arial][SIZE=2][COLOR=#000000]=IF(AND(OR(J255="Closed",J255="Auto-closed"),C255=1,NETWORKDAYS(D255,O255)<=17),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]IF(AND(OR(J255="Closed",J255="Auto-closed"),C255=2,NETWORKDAYS(D255,O255)<=17),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]IF(AND(OR(J255="Closed",J255="Auto-closed"),C255=3,NETWORKDAYS(D255,O255)<=10),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]IF(AND(OR(J255="Closed",J255="Auto-closed"),C255=4,NETWORKDAYS(D255,O255)<=5),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]IF(AND(OR(J255="Closed",J255="Auto-closed"),C255=5,NETWORKDAYS(D255,O255)<=1),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]IF(AND(C255=1,NETWORKDAYS(D255,P255)<=17),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]IF(AND(C255=2,NETWORKDAYS(D255,P255)<=17),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]IF(AND(C255=3,NETWORKDAYS(D255,P255)<=10),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]IF(AND(C255=4,NETWORKDAYS(D255,P255)<=5),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]IF(AND(C255=5,NETWORKDAYS(D255,P255)<=1),"OnTime",[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]
[FONT=arial][SIZE=2][COLOR=#000000]"OUT"))))))))))[/COLOR][/SIZE][/FONT][FONT=Calibri][SIZE=3][COLOR=#000000]<o:p></o:p>[/COLOR][/SIZE][/FONT]


First part of formula is - look at J for “closed” if its there do this math.
2nd part is - Otherwise (if J doesn't have anything, or says something else) do this math.
For some reason, in the 2nd part of formula, that Column O that im pulling from to do the math function in the first part is effecting the 2nd part.
When I click on the empty cell in O, and simply press delete, the formula all of the sudden works.


Ideas?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Hi,

Don't know why you're experiencing what you described, perhaps check the referenced cells in C, D, O, P that they all contain Numbers and is/are Not Text ( use =ISNUMBER(cell reference) to test).

In the meantime, I've "cleaned upped" your nested IF a little (it should be following the exact same logic as the formula you posted):


Book1
C
1No Match
Sheet70
Cell Formulas
RangeFormula
C1=IF(OR(J255={"Closed","Auto-closed"}),IF(OR(AND(OR(C255={1,2}),NETWORKDAYS(D255,O255)<=17),AND(C255=3,NETWORKDAYS(D255,O255)<=10),AND(C255=4,NETWORKDAYS(D255,O255)<=5),AND(C255=5,NETWORKDAYS(D255,O255)<=1)),"OnTime",IF(OR(AND(OR(C255={1,2}),NETWORKDAYS(D255,P255)<=17),AND(C255=3,NETWORKDAYS(D255,P255)<=10),AND(C255=4,NETWORKDAYS(D255,P255)<=5),AND(C255=5,NETWORKDAYS(D255,P255)<=1)),"OnTime","OUT")),"No Match")
 
Upvote 0
Oops, just realized I have a misplaced bracket, please ignore the formula I posted above, this is the corrected version.

Also, I don't think the first part of Your formula looking at O is affecting the second part of your formula, since if J is not "closed", the rest of the first part will Not "fire", and will go directly to the second part without looking at O.


Book1
C
1OUT
Sheet70
Cell Formulas
RangeFormula
C1=IF(OR(J255={"Closed","Auto-closed"}),IF(OR(AND(OR(C255={1,2}),NETWORKDAYS(D255,O255)<=17),AND(C255=3,NETWORKDAYS(D255,O255)<=10),AND(C255=4,NETWORKDAYS(D255,O255)<=5),AND(C255=5,NETWORKDAYS(D255,O255)<=1)),"OnTime","OUT"),IF(OR(AND(OR(C255={1,2}),NETWORKDAYS(D255,P255)<=17),AND(C255=3,NETWORKDAYS(D255,P255)<=10),AND(C255=4,NETWORKDAYS(D255,P255)<=5),AND(C255=5,NETWORKDAYS(D255,P255)<=1)),"OnTime","OUT"))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top