Abbreviated Month Names

I feel like this is so simple but somehow I can’t figure it out…

I have one column with a date value, and a second column, which is a text formula, that I want to display as “21-01-Jan” etc, based on the date in that first column.

So I’m going for 2-digit year + 2-digit month number + 3-character month name.

I’ve tried using the format function, and this bit from the MonthName formula

…but I’m not sure how to actually use this in the formula. :confused: Is it this?

Format(“{MMM}”,[Date].MonthName())

…because that’s literally returning 2021-01-{MMM}.

I’ve tried a bunch of things but the only thing that’s worked so far is the Month Number bit. The rest I’m lost on. Here’s where I am currently, which displays as 2021-01-January:

Concatenate([Date].Year(),“-”,Format(“{1:00}”,[Date].Month()),“-”,[Date].MonthName())

Grateful for your brains on this little silly thing!

Hi @Kelly_Claus :blush: !

Actually, the “MMM” or “MMMM” you can use in MonthName() is the 2nd and optional parameter you can place within the brackets of MonthName(), after the mandatory DateTime :blush: .

MonthName(dateTime, format)

E.g. : something like…

MonthName(Date(2021,11,29), "MMM")

… will return → Nov

or

MonthName(Date(2021,11,29), "MMMM")

… will return → November :blush: .

If you “chain” it you could have something like :

Date(2021,11,29).MonthName("MMM")

it would also return → Nov

The format in the documentation concerning this formula, is the format to use for this parameter in MonthName(). (and has nothing to do with Format() :blush: )

Now, concerning the specific formatting you want to use maybe this could help you :

Format(
  "{1}-{2:00}-{3}",
  thisRow.Date.Year().Right(2),
  thisRow.Date.Month(),
  thisRow.Date.MonthName("MMM")
)

Here is a quick simple, just to illustrate :blush:

5 Likes

Amazing, thank you!!

No problem @Kelly_Claus :grin: !

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.