I have a column called “Date”. I’d like another column to look at my date column and if the date is in the same month as TODAY(), then it should say “This Month”. If the date is last month when compared to TODAY(), then it should say “Previous Month”. To be clear, I don’t want it to look at the previous 30 days. So, if a record has a date of 06/30/20 and today is 07/01/20 then that record would say “Previous Month”, but its month is in a previous month when compared to TODAY(). Does that make sense?
Solved
Formula To Flag Record (This Month, Previous Month, Other)
Best answer by Justin_Barrett
Here’s what I came up with. This was fun to play with, but as has already been discussed, it was tricky covering all possible options.
IF(
Date,
IF(
Date < TODAY(),
IF(
MONTH(Date) < MONTH(TODAY()),
IF(
MONTH(TODAY()) - MONTH(Date) = 1,
"Previous",
"Past"
),
IF(
MONTH(Date) > MONTH(TODAY()),
IF(
(MONTH(TODAY()) + 12) - MONTH(Date) = 1,
"Previous",
"Past"
),
"This"
)
),
IF(
Date > TODAY(),
IF(
MONTH(Date) > MONTH(TODAY()),
"Future",
IF(
YEAR(Date) > YEAR(TODAY()),
"Future",
"This"
)
),
"This"
)
) & " Month"
)

Login to the community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.


