Add a Completed Status Condition to an Excel IF Formula
Question details
The user wants to hide due-date messages for completed tasks while retaining date calculations for other tasks.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A task tracker uses a due date, a status, and a reference date to display overdue or upcoming messages.
- Observed behavior
- The desired formula returns a blank for completed tasks or empty due dates and displays the appropriate due-date message otherwise.
Check that J8 contains a valid due date, L8 contains the task status, and N1 contains a valid reference date. Use dates without time values if you want whole-day calculations.
Use OR in the outer IF formula to hide completed tasks
Return a blank when the due date is empty or the task is marked Completed, while preserving the other date messages.
In Excel, select the cell where you want the due-date message for row 8 to appear.
Type =IF(OR(J8="",L8="Completed"),"",IF(J8-$N$1<0,"overdue by: "&(J8-$N$1)*-1&" day(s)",IF(J8-$N$1=0,"due today","due in: "&(J8-$N$1)&" day(s)"))) and press Enter.
Set L8 to Completed to check that the message is blank. Change the status to test the date message, then drag the cell's fill handle down to apply the formula to other task rows.

Manage task due dates with WPS Spreadsheets
Use the same IF and OR formula in WPS Spreadsheets to hide due-date messages for completed tasks and calculate messages for remaining tasks.
- 1. Open the task tracker: Open WPS Spreadsheets and choose Open to select your Excel task tracker.
- 2. Check the source cells: Confirm that J8 holds the due date, L8 holds the status, and N1 holds the reference date, or adjust the formula references to match your sheet.
- 3. Enter the formula: Select the message cell for row 8, enter =IF(OR(J8="",L8="Completed"),"",IF(J8-$N$1<0,"overdue by: "&(J8-$N$1)*-1&" day(s)",IF(J8-$N$1=0,"due today","due in: "&(J8-$N$1)&" day(s)"))), and press Enter.
- 4. Apply it to other tasks: Test the formula by entering Completed in L8, then drag the message cell's fill handle down to the remaining task rows.

Frequently Asked Questions
Why does the formula return a blank for a task?
The outer IF returns an empty string when J8 is empty or L8 equals Completed. Check those cells if you expected a due-date message.
What date does the formula compare against?
It compares the due date in J8 with the date in N1. Enter a valid reference date in N1, or use =TODAY() there to compare against the current date.
Does the Completed status need to match the capitalization exactly?
No. Excel's standard text comparison is not case-sensitive, so Completed and completed both match. Extra spaces can prevent a match.
Why does the formula use $N$1 instead of N1?
The dollar signs make N1 an absolute reference, so it stays fixed when you drag the formula down. The J8 and L8 references change for each row.




