How to Use IF Function with Dates in Excel (4 Examples)

Working with dates in Excel is common, especially when you’re tracking deadlines, calculating overdue tasks, or comparing sales timelines. The IF function is one of the most useful tools when it comes to handling dates and applying logic like Before A Date, After A Date, or Between Two Dates.

Using the IF function with dates allows you to evaluate conditions and return results based on specific time criteria. You can highlight upcoming events, mark overdue items, or flag entries that fall within a certain period.

In this article, we’ll learn how to use the IF function with dates in Excel for common tasks like checking if a date is in the past, future, today, or between two given dates.

Key Takeaways

Here’s how to use the IF function with dates in Excel to check if a task is overdue:

➤ Open your dataset in Excel.
➤ Click on cell D2 and enter the following formula:
=IF(B2<TODAY(), “Overdue”, “On Time”)
➤ Press Enter. Excel will mark each task as Overdue or On Time based on today’s date.
➤ Drag the fill handle down to apply the formula to the rest of the rows.

overview image

Download Practice Workbook
1

Using IF with TODAY Function to Check If a Task Is Overdue

In the following dataset, we have a simple task tracker that monitors project activities over time. Column A lists the Task Names, Column B shows the Start Dates, and Column C contains the Due Dates. Column D is currently empty and will be used to display the task Status based on various date conditions.

Using IF and TODAY Function To Check If a Task Is Overdue

We’ll use this dataset to demonstrate multiple methods for using the IF function with dates in Excel.

One of the most common uses of the IF function with dates in Excel is to check whether a task is overdue. A task is considered overdue if its Due Date has passed and it hasn’t been marked as completed yet. To do this, we’ll compare the value in the Due Date column against today’s date using the TODAY function.

In this method, we want to label each task in Column D as either Overdue or On Time, based on whether the due date has already passed.

Here’s how to apply this method:

➤ Open your dataset in Excel.
➤ Click on cell D2, where we want to display the status of the first task.
➤ Enter the following formula:

=IF(C2<TODAY(), "Overdue", "On Time")

Using IF and TODAY Function To Check If a Task Is Overdue

➤ Press Enter. You’ll see the result display as Overdue because the due date is before today’s date.

Using IF and TODAY Function To Check If a Task Is Overdue

➤ Now, drag the fill handle down from D2 to D11 to apply the formula to the rest of the rows.

Using IF and TODAY Function To Check If a Task Is Overdue


2

Identify Upcoming vs Past Due Tasks

You may also want to identify tasks that are scheduled for the future. In other words, tasks whose due dates are after today. These are considered upcoming tasks, and flagging them helps in prioritizing what’s next.

In this method, we’ll use the IF function to compare the due date with today’s date and label tasks accordingly.

Here’s how to do it:

➤ Click on cell D2.
➤ Enter the following formula:

=IF(C2>TODAY(), "Upcoming", "Past Due")

Identify Upcoming vs Past Due Tasks

➤ Press Enter. You’ll see the result displayed as Upcoming if the due date is later than today’s date.

Identify Upcoming vs Past Due Tasks

➤ Now, drag the fill handle down to copy the formula to the rest of the rows.

Identify Upcoming vs Past Due Tasks


3

Check If a Task Is Due Today

Another helpful way to use the IF function with dates is to find out which tasks are due today. This is useful for daily check-ins, dashboards, or to-do lists that need to highlight what’s scheduled for the current date.

In this method, we’ll compare each task’s due date with today’s date using the IF and TODAY functions.

Here’s how to apply this method:

➤ Click on cell D2, where we want to check if the first task is due today.
➤ Enter the following formula:

=IF(C2=TODAY(), "Due Today", "")

Check If a Task Is Due Today

➤ Press Enter. You’ll see the result display as Due Today if the due date matches today’s date. If not then the cell remains empty.

Check If a Task Is Due Today

➤ Now, drag the fill handle down to apply the formula to the rest of the rows.

Check If a Task Is Due Today


4

Check If a Task Falls Between Two Dates

Sometimes, you may want to filter tasks that fall within a specific date range, such as tasks scheduled during a particular week or month. This is useful for reporting, sprint planning, or generating custom views of your schedule.

In this method, we’ll combine the IF function with the AND function to check if a due date falls between two specific dates.

Here’s how to apply this method:

➤ Click on cell D2.
➤ Enter the following formula:

=IF(AND(C2>=DATE(2025,7,5), C2<=DATE(2025,7,25)), "In Range", "Out of Range")

Check If a Task Falls Between Two Dates

➤ Press Enter. You’ll see the result display as In Range if the due date is between July 5 and July 25, 2025.

Check If a Task Falls Between Two Dates

➤ Now, drag the fill handle down to apply the formula to the rest of the rows.

Check If a Task Falls Between Two Dates


Frequently Asked Questions

Can I compare two date columns using the IF function?

Yes. You can use a formula like =IF(B2>C2, “Started Late”, “On Schedule”) to compare start and due dates. This lets you identify tasks that were started after their due dates or ahead of schedule.

Does the TODAY function update automatically?

Yes. The TODAY function refreshes every time you open or recalculate the workbook. It always returns the current system date, so your formulas stay up to date.

What happens if the date column contains blank cells?

If a cell is blank, formulas like =IF(C2<TODAY(), “Overdue”, “On Time”) may still return Overdue because Excel treats blank cells as 0. To avoid this, use a more precise formula like =IF(C2=””, “”, IF(C2<TODAY(), “Overdue”, “On Time”)).


Wrapping Up

The IF function with dates in Excel is a simple way to track progress, check deadlines, and apply custom logic to your schedule. You can use it to find overdue tasks, highlight those due today, or check if a date falls between two fixed points.

Each method in this article shows a different type of comparison using dates. Use the method that fits your dataset and goal. With just a few formulas, you can make your task list more useful and easier to manage in Excel.

ExcelInsider Team
We will be happy to hear your thoughts

Leave a reply

Excel Insider
Logo