I am working on a spreadsheet where I need to get the result of a 1, 2 or 3 depending on the conditions in an if statement, however excel is behaving very strangely. I have attached the image below and the IF statement (feel free to advise if the statement can be improved). I wonder if anyone can explain whats going on?

The issue I am experience is that The top line, and 3rd line arent different in term of status, no completed date and no revised date. The statement I am running to output 1,2, or 3 is as follows:
=IF(AND(K16<>"",J16="",OR(K16<=I16,K16<=J16)),1,IF(AND(K16<>"",J16<>"",K16<=J16,K16>I16),2,IF(AND(K16<>"",J16<>"",K16<=I16),1,IF(AND(K16="",E15="Completed"),1,IF(AND(K16="",OR(E16="Behind Target",E16="Not Started")),3,IF(AND(K16="",E16="On Target"),2,3))))))
Can anyone advise please. I am using excel 2003
First of all, your formula points to cell
E15but should probably point toE16. That alone may fix your problem. If not, the formula below follows these rules:which have finished after the original target but before the revised target date or are marked as on target but not yet completed
should be anything are behind target or not started and have nothing in the completed date field
=IF(OR(E16="Completed",AND(K16<>"",K16<=I16)),1, IF(OR(E16="On Target",AND(K16>I16,K16<J16)),2, IF(AND(K16="",OR(E16="Behind Target",E16="Not Started")),3)))