Excel Calculate Years Between Dates

So, there I was, staring at my grandma's old photo album, trying to figure out how many candles we'd need for her upcoming birthday cake. I mean, who doesn't love a good birthday surprise, right? But here's the thing, Grandma's been around the block a few times, and her birthdate was scribbled in pencil on the back of a faded Polaroid. I knew I had to get my trusty Excel spreadsheet involved, but how do you calculate years between dates when the dates are... well, let's just say they're not as fresh as yesterday's bread?

Now, I'm not one to shy away from a challenge, especially when it involves my favorite spreadsheet software. So, I fired up Excel, ready to tackle this date conundrum. And that's when I remembered, Excel's got a little trick up its sleeve for calculating years between dates. It's called the DATEDIF function, and it's about to become your new best friend.

Introducing DATEDIF: Your New Best Friend

Alright, let's dive into this DATEDIF business. It's a built-in Excel function that calculates the difference between two dates. But here's the kicker, it can also tell you the difference in years, months, or days. Pretty nifty, huh? Let's break it down.

Syntax: DATEDIF(start_date, end_date, unit)

See that syntax up there? That's how you tell Excel what you're cooking up. start_date and end_date are the dates you're working with, and unit is what you want the difference to be calculated in - "y" for years, "m" for months, or "d" for days.

For example, if you want to know how many years have passed between Grandma's birthday (let's say that's 01/01/1940) and today (which is 01/01/2022), you'd type this into a cell:

=DATEDIF(01/01/1940, 01/01/2022, "y")

And voila! Excel would spit out 82, telling you that Grandma's been around for 82 years. Pretty neat, huh?

But Wait, There's More!

Now, you might be thinking, "That's all well and good, but what if I want to know how many months or days have passed too?" Well, my friend, DATEDIF's got you covered. Just change the "unit" to "m" for months or "d" for days.

For instance, if you want to know how many months have passed between Grandma's birthday and today, you'd type:

Find Dates Between Two Dates Excel at Piper Blanc blogFind Dates Between Two Dates Excel at Piper Blanc blog

=DATEDIF(01/01/1940, 01/01/2022, "m")

And Excel would tell you it's been 1004 months. Now, I don't know about you, but I find that a tad bit overwhelming. I mean, who's counting months anymore? But hey, at least we know Excel's got our backs.

One Last Thing...

Now, you might be wondering, "What if the dates I'm working with are in text format?" Well, Excel's not one to leave us hanging. You can convert text dates to Excel dates using the DATEVALUE function. Just wrap your text date in DATEVALUE like this:

=DATEDIF(DATEVALUE("01/01/1940"), 01/01/2022, "y")

And just like that, you've got your years, months, or days. Easy peasy, lemon squeezy!

So there you have it, folks. The next time you're trying to calculate years between dates in Excel, don't let those dates give you the slip. Whip out DATEDIF, and you'll be calculating years, months, or days like a pro in no time. Now, go forth and conquer those dates!