April 25, 2024

MoDCore

Welcome to the core

Extract Month from a date

Extract Month from a date

There are a couple of ways to extract just the month from a date in excel. Here are the 2 major ways it can be done.

=Month()

=MONTH(A2) – returns the month of a date in cell A2.

=MONTH(DATE(2015,4,15)) – returns 4 corresponding to April.

=MONTH("15-Apr-2015") – obviously, returns number 4 too.

=TEXT()

=TEXT(A2, "m") – returns a month number without a leading zero, as 1 – 12.

=TEXT(A2,"mm") – returns a month number with a leading zero, as 01 – 12.

 

Be careful when using TEXT formulas, because they always return month numbers as text strings. If you plan to use the month to then complete some further calculations or use the returned numbers in other formulas, you would be better off using the =Month()  to complete the work you need it for.

 

Copyright © All rights reserved. | Newsphere by AF themes.