How To Highlight Timestamps Last Month
Learn how to highlight timestamps from the previous month using Google Sheets formulas and conditional formatting techniques. This tutorial walks you through the necessary steps to effectively apply these formulas in your spreadsheets.
We want to highlight timestamps last month. This means we need to know the month of the timestamp , and the month of today. So we have some really interesting little formulas that will help us, which is month. And we just wrap . any timestamp or any date with the month, and we know what month it's in. This is 12, this is 1 here, it's January. So we're just looking for a number 1 through 12. We can, That month around today, And say, hey, today is 1, or January. That's the month of today's date. And this formula today will constantly be changing. So let's apply this to conditional formatting . We have a few steps to go through, and I want to walk you through them all. every one of them. Let's go up to Format , Conditional Formatting . Over on the right side, we'll get our entire range, A colon A.
And, we will select Custom Formula Is . We'll do equals month A1. That's just saying, hey, we want to know, for our time stamp that we're looking at, What's the month? And is it equal to month today but minus one? Now you'll notice , nothing is highlighted. It's because this month today minus one is actually zero. To just in january every other month, of the year, this would work perfectly fine. And you might not even know that there's going to be an error or nothing in January, but this won't work in January. We need to add a few things to it. One, we need to wrap if. Today, minus one, is equal to zero. Well, what do we want to do if it's true? If it's true, we just want 12, because we know zero actually means 12.
And if it's false, We want the actual month today, minus one. And so we'll wrap that. And we'll get the right answer. We'll get the December is highlighted here. But we also have some extras highlighted. That's because any blank cells also mean zero. And so we're going to get those caught up here. So we need to do one more thing. And wrap another if around our if. And say is date. We just want dates. And One, and if it is true, if it is a date, do our calculation , and then at the very, very end, add another comma, and have a false, basically when it's false, we want nothing. And so, we have this beautiful conditional formatting , which I've copied and pasted here so you can see the whole thing all at once.
Here's the whole thing all at once. I'm just showing it to you here for the conditional formatting . We're saying, hey, look at the month of A1 and then we're saying, hey, is it a date? If it is, let's do some calculations to it. If it's not over here on the far right, just do nothing. Okay. So it is a date. And if it's today is zero, then today's going to be 12. Now, are these two same, but if it's not. We're going to do the month of today minus one to find out the real number . That's how you highlight timestamps last month. Hope you enjoy that. Hope you subscribe here on YouTube to better sheets and make your spreadsheets better.