Excel中为IF函数添加“Not Started”变量的技术求助
Got it, let's get this formula sorted for you! You want to extend the original check so that both "In Process" and "Not Started" trigger the overdue logic against cell N6. Here are two straightforward, reliable ways to do this:
Method 1: Use the OR Function (Most Intuitive)
This is the easiest approach for adding multiple exact matches to your condition. We’ll wrap the two status checks in an OR() function, which returns TRUE if either condition is met:
=IF(OR(A6="In Process", A6="Not Started"), IF(TODAY()>N6, "Past Due", ""), "")
Breakdown:
OR(A6="In Process", A6="Not Started"): Checks if A6 is either of the two statuses- If that’s true, run the inner
IF(TODAY()>N6, "Past Due", "")to flag overdue items - If neither status matches, return an empty string (
"")
Method 2: Use the IN/MATCH Combo (Scalable for More Statuses)
If you think you might add more statuses later, this method is cleaner. We use MATCH() to check if A6 exists in a list of target statuses, then ISNUMBER() to confirm a match was found:
=IF(ISNUMBER(MATCH(A6, {"In Process", "Not Started"}, 0)), IF(TODAY()>N6, "Past Due", ""), "")
Or, for a shorter (but slightly less explicit) version:
=IF(A6={"In Process", "Not Started"}, IF(TODAY()>N6, "Past Due", ""), "")
This works because Excel will evaluate the array comparison and return the matching result.
Either of these should solve your issue—just drop them in place of your original formula and test with both statuses to make sure it’s working as expected!
内容的提问来源于stack exchange,提问作者jmensay

