Reputation: 1
I'm trying to create a spreadsheet that returns if an item was completed on time or not. "A" column is either "Open" or "Closed". If the "A" column is "Open" then I want to return a blank cell. If the "A" column is "Closed" then it needs to calculate dates in column "B" and "X" to see if it was on time or not. The first part of the formula is returning blanks as it should. The two "IF(AND" statements that follow seem to be causing all cells in column "A" that are "Closed" to return a "No". Been digging at this for two days trying different ways of writing a formula with no success. The "X" column is calculated by adding two columns together...not sure if that makes a difference.
=IF(A2="Open"," ",IF(AND(A2="Closed",X2>=B2),"Yes",IF(AND(A2="Closed",X2<B2),"No")))
I expect if A2="Open" then it would return a blank cell. This is working as expected.
I expect if A2="Closed"
then X2>=B
2 would return a "Yes" and if X2<B2
it would return a "No". There are no errors identified by Microsoft Excel.
Upvotes: 0
Views: 89
Reputation: 3145
It may be that Excel is interpreting your dates as strings instead as dates. You can investigate by:
B2
.B2
is selected, hit the F9
key to show its value.F9
will convert it to a number like 41609
.
If it's a string you'll get "May 16, 2019"
.CTRL-Z
to revert back to the original formula.X2
.Hope that helps
Upvotes: 0
Reputation: 1230
If A2 can only be "Open" or "Close",
syntax of your If
should be :
=IF(A2="Open"," ",IF(X2>=B2,"Yes","No"))
Upvotes: 2