Connect with us

Hi, what are you looking for?

Tech

Excel Date Formulas Simplified – A Case Study

Overview

Many Excel users are downright scared of date formulas. At one point in my Excel career I was one of those users. But since dates are found in most Excel workbooks, I had to overcome my fears. And you know what? Date formulas aren’t half as scary as I thought they were.

In this article I hope to show you how simple and useful Excel date formulas can be. In our case study, you’ll see how by using a single date function (the MONTH() function) and some filtering we can accomplish real-world tasks like keeping track of impending birthdays of employees.

Using the MONTH() function in an Excel Formula

So here’s a list of some of the employees of the fictitious XYZ widget company:

excel1

We’ll use the MONTH() function for two separate tasks. The first is to find the current month. We do this with the formula =MONTH(TODAY()).

The TODAY() function returns the current date, we then take this date and extract the ‘month part’ from it by using the MONTH function. And the result is the current month.

Cell C2 in the screen shot below holds the result.

excelc2

The second task for the MONTH() function is to calculate the month in which each employee was born. We’ll do this by using the MONTH function to return the month part of each employee’s date of birth. This is accomplished by doing the following:

  • We will select cell D5, and type in the following formula: =MONTH(C5).
  • And then we will copy the formula to all the cells in the D column.

Note: This time we used the MONTH() function to extract the month part of the employees birth-dates. These dates are found in column C and column D will now contain the month of birth for each person. In our sample, it’s 1 for John, 1 for Roger, 12 for Ananias, and so on:

excel3

Matching the Criteria

So, now we have all the data we need: the current month and the birth month of each person. The final step is to check out if they’re the same:

  • We’ll select cell E5 and type in: =IF(D5=$C$2,”YES”,”NOPE”).
  • And copy the formula to all the table cells in the E column.

Each cell will display either YES if that person’s birthday is this month, or NOPE if it isn’t:

excel4

And we can now easily filter only the employees that have a birthday this month using Excel’s Filter functionality:

excel5

Summary

In this article, we discussed a real-world use-case for the MONTH() and TODAY() functions. I hope that by now you see that date formulas can be simple to use and understand. I’ll leave you with a puzzle:

Instead of creating the ‘Month of Birth’ column and the ‘Current Month’ cell, we could have used the following formula in the ‘Birthday This Month’ column:

=IF(MONTH(C5)=MONTH(TODAY()), “YES”, “”)

Can you figure out why it works?

Written By

Joseph Reese is the founder and chief expert in an Excel Formulas consulting firm. Head over to his website if you want to improve your performance with Excel.

8 Comments

8 Comments

  1. JJ

    March 23, 2011 at 4:31 pm

    Great post that really cleared things up for me!

  2. Joe

    March 23, 2011 at 4:53 pm

    Hi JJ,

    Glad I could help.

  3. fanatsic sams

    March 26, 2011 at 2:42 am

    I have worked on excel but not too deep. Really informative post.

  4. Admin

    March 27, 2011 at 6:50 pm

    Thanks for the comments guys and thanks for the article Joe.

  5. Ben

    July 19, 2011 at 5:01 am

    Thanks for this. Even though I’ve worked with Excel many times before I’m still such a newb. Would you recommend getting a certification from Microsoft or just sticking to free online learning…like this 🙂

  6. Christian

    October 28, 2011 at 1:15 pm

    really nice blog post with useful explanation on how to use two Excel data formulas. Thanx for sharing the knowledge. Of course there is other usefuldata formulas as well – that is for instance day, year, datediff and so on 🙂

  7. Cyracks

    October 9, 2013 at 1:35 am

    Thanks for this nice write up, excel is quite a fantastic application to use. I teach excel in an IT institution and this post will be useful to my students. I will surely direct them here. Thanks a lot. I love things like this.

  8. james

    November 25, 2013 at 2:40 pm

    Thank you for this nice post. Great job

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

You May Also Like

Digital Marketing

Tracking your company’s reach, creating and following your posting schedule, allocating funds on ads, and living at the same time might seem impossible to...

Tech

These days, it would be near-impossible to survive working as a manager without knowing how to work with Microsoft Excel. It’s proven itself useful...

Computer

This article is intended for those wishing to learn more about Microsoft Excel and for those using Microsoft Excel Version 2010. So you are...

Computer

Microsoft Excel is a very important tool for employees all over the world. At a very traditional evaluation, almost 250 million individuals are utilizing...