Nov 13 2023 08:54 AM
Hi
Im trying to write an IF formula and its erroring
Basically I this formula worked but i needed the 'not completed' part added!
=IF(L4>TODAY(),"Compliant", IF(P4>TODAY(),"Pending",IF(V4>TODAY(),"Pending","Not Completed")))
want to say if 'L4 is today or in the future bring back 'Completed' but if less than today 'Expired'
if P4 or VA are today or in the future to bring back 'Pending', or if none of the columns have any dates 'Not Completed'
HOW DO I WRITE THIS PLEASE????? URGENT HELP NEEDED
Nov 14 2023 05:29 AM
so my formula which works for the most part is
but it not showing Expired for any row
and if there is a completed expiry date in the past AND a pending in the future it says Compliant but it should say Pending
I would say, based on those concluding lines, that it's NOT working for the most part.
I truly don't have time to go through in depth and try to reconstruct. What I'd recommend is that you take each condition separately and make sure it is working before you string them together.
That is to say, look at each line in the formula as it's arrayed below. Work on each one separately, each in its own column. Combine them after each one is working.
I can tell you just looking at that first line under IFS, the one I've underlined, where you've put an AND condition inside an OR, that the OR is not working. Have you learned to count the pairs of parentheses? Count 1 for each open paren, subtract 1 for each closing paren. The count goes back to zero before any alternative (OR) condition is described..and then there's the "Not Completed" consequence.
=IFS(
OR(AND(ISBLANK(K4),ISBLANK(O4),ISBLANK(U4))),"Not Completed",
OR(K4>=TODAY()),"Compliant",
OR(AND(K4<TODAY(),OR(O4<TODAY(),ISBLANK(O4)),OR(U4<TODAY(),ISBLANK(U4)))),"Expired",
OR(AND(K4<TODAY(),O4>=TODAY())),"Pending",
OR(AND(K4<TODAY(),U4>=TODAY())),"Pending"
)
Nov 14 2023 08:29 AM
Nov 14 2023 08:44 AM
@SGeorgie While reading through this thread, I noticed some conflicting statements made about the logic. However, looking at your original question with the first formula your tried, then comparing that to the last formula you tried, I think this might be what you want:
=IFS(AND(ISBLANK(K4),ISBLANK(O4),ISBLANK(U4)), "Not Completed", K4>=TODAY(), "Compliant", OR(O4>=TODAY(), U4>=TODAY()), "Pending", TRUE, "Expired")
The IFS function evaluates each logical test in order and returns the corresponding value for the first TRUE result found. When a logical test returns TRUE, none of the subsequent tests will even be evaluated, so it's important to get the order correct. The above formula is evaluated as follows:
I hope this works as expected, or at least serves as a guide for how to use the IFS function correctly to figure out the logic you need.
Nov 14 2023 08:50 AM
Nov 14 2023 08:53 AM
Nov 14 2023 09:01 AM
@SGeorgie I just input those dates into my spreadsheet and it returned "Pending" correctly. My only guess would be that your date cells are formatted as Text. Please make sure they are formatted as Dates and try again.
Nov 14 2023 09:29 AM
@SGeorgie Also, verify that your current systems settings accurately reflect today's date. Other than that, I'm out of ideas. Even the last really long IFS formula you posted works correctly in my spreadsheet, so there must be something going on with either the way your data is formatted, or with your current system date settings.
Nov 14 2023 10:35 AM
@SGeorgie One last suggestion... make sure your Calculation Options are set to Automatic, or press F9 on your keyboard to recalculate the entire workbook. The most likely reason you're getting incorrect results is that your Calculation Options are set to Manual.
Nov 15 2023 02:32 AM
Nov 15 2023 04:08 AM
@SGeorgie Please see the attached example file that's confirmed to be working on my system. Download it, if possible, then add or change dates in each column to create various scenarios and see if it's working for you. If not, then the problem most likely lies on your end with either a system setting or Excel setting. If it works correctly, though, and you're still not able to identify the reason why your file is not working, try to attach a dummy file in your next reply (go to the full editor, then find the area to "browse files to attach" below the editor).