MONTH ()
This
function extracts the month as number from a complete date.
Best view in desktop mode.
A
|
B
|
C
|
|
1
|
Original Date
|
Month
|
|
2
|
26-Jan-20
|
1
|
=MONTH(A2)
|
3
|
15/08/19
|
8
|
=MONTH(A3)
|
4
|
August 15, 2019
|
8
|
=MONTH(A4)
|
5
|
Syntax
=MONTH(Date)
=MONTH(serial_number)
Formatting
No special
formatting is needed.
The result will be
in number from 1 to 12.
Example
The following example
to check both date’s months are same or not and give the result in True/False.
A
|
B
|
C
|
D
|
E
|
|
1
|
Date 1
|
Date 2
|
Function
|
||
2
|
26-Jan-20
|
20-Jan-20
|
TRUE
|
=MONTH(A2)=MONTH(B2)
|
|
3
|
15/08/19
|
15/06/19
|
FALSE
|
=MONTH(A3)=MONTH(B3)
|
|
4
|
10/11/2019
|
10/11/2019
|
FALSE
|
=MONTH(A4)=MONTH(B4)
|
|
5
|
10
|
11
|
|||
6
|
=MONTH(A4)
|
=MONTH(B4)
|
|||
7
|
In cell A4 and B4, you can see both dates are looking same but the result is
showing False.
This is
because in cell A4, date format is mm/dd/yyyy and month number is 10.
But in cell B4,
date format is dd/mm/yyyy and month number is 11.
No comments:
Post a Comment