Forum Discussion
SGeorgie
Nov 13, 2023Brass Contributor
IF FORMULA - Help Needed please
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",...
mathetes
Nov 13, 2023Silver Contributor
I started to try to create a spreadsheet to write and test a formula for you, but realized I don't fully understand the various possible conditions. For one thing, it's not clear whether one can expect that either:
- all three cells (L4, P4 and V4) will be blank, OR
- any one of the three cells, but only one of them, will have a value, OR
- some combination of two OR three of the cells can have a value
In the first case--where they're all blank--it's clear that "Not completed" is the desired result, but it's not clear (to me at any rate), what we're dealing with beyond that. How many of the cells will have a value: only one, any two, all three?
Could you please clarify. If possible, describe the setting, what the context is.
AND, ideally, since you're clearly working with an existing spreadsheet, would you be able to post a copy of that actual spreadsheet along with your explanation, putting it on OneDrive or GoogleDrive, with a link pasted here that grants access to it. Not an image, an actual working spreadsheet.
- SGeorgieNov 14, 2023Brass Contributor
Apologies I cannot attach the excel as
Here are all scenarios
ALL Expiry Date columns BLANK - this should say 'Not Completed'
Only Completed expiry date completed (in future) - this should say 'Compliant'
Only Completed expiry date completed (in past) - this should say 'Expired'
Pending and Pending Pending Approval with future date - this should say 'Compliant' -
This has both Completed and Pending - dates in future - should say 'compliant'
if Completed date were in past but Pending in future it should still say 'Compliant'
You will not see Complete (past) and pending/pending approval (past)
That is all the scenarios i can see
- SGeorgieNov 13, 2023Brass Contributorscreenshot is attached as quite sensitive info
- SGeorgieNov 13, 2023Brass ContributorHi, so in my data we have a completed date column
a pending date column
and a pending approval date column
if ALL three are blank i'd like the formula to produce 'Not Completed'
If there is only a Completed date but its expired the formula should show expired
if there is either a pending or pending approval date in the future it should say pending
if either of these dates are in the past it should say expired- mathetesNov 13, 2023Silver Contributor
Your answer doesn't seem to cover all the possibilities. You have to realize, that you, since you're IN the situation, consider the answer to the following question is obvious and therefore not worth stating.
This is a question I would be asking if we were sitting down face to face, and I apologize if it seems so obvious to you:
Is it ever the case that two or more of the cells L4, P4 and V4 will have values in them?
I understand what happens if any one of them has a value, but to me it's not clear whether two or more might have a value and what happens then if those values are inconsistent.
And since that still needs answering, let me pose another, which gets at the basic design.
In your most recent post you referred to those cells by labels (perhaps a column heading) and those labels themselves are
- Completed
- Pending
- Pending Approval
meaning that whoever is entering the data needs to pick a column that corresponds to the state of pending or completion--in other words., that entry already presumes the answer to the question this IF function is proposing to answer--so WHY do you even need a formula that answers the question??!!
That is a serious question.That's a big part of why I asked before if it is possible for you to post a copy of the spreadsheet itself. Especially since two of the cells apparently are going to contain dates that reflect--or appear to reflect--almost identical data: "Pending" and "Pending Approval" It just sounds like a confusing design, and part of what NikolinoDE and I (and others on this site) offer is help in making sure spreadsheet designs make sense, not just that formulas work.
- SGeorgieNov 14, 2023Brass Contributorso yes they may do and this is when you have a past completed date and then EITHER a pending or a Pending approval date
They are purely date columns for if it is a completed certificate, one which is pending or one which is pending approval - we need to clearly see where we are compliant and where we are not.