ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date Management (https://www.excelbanter.com/excel-programming/325142-date-management.html)

Nigel

Date Management
 
Hi All
What is the simplest way to determine from a DATE the prior month number?

eg Using European Date format
1/03/2005 would give 2 as the prior month
10/01/2005 would give 12


--
Cheers
Nigel





Niek Otten

Date Management
 
=MONTH(DATE(YEAR(A1),MONTH(A1)-1,1))

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel


"Nigel" wrote in message
...
Hi All
What is the simplest way to determine from a DATE the prior month number?

eg Using European Date format
1/03/2005 would give 2 as the prior month
10/01/2005 would give 12


--
Cheers
Nigel







K Dales[_2_]

Date Management
 
Assuming the date you want to use is in A1, =IF(MONTH(A1)=1,12,MONTH(A1)-1)
will do the trick.

"Nigel" wrote:

Hi All
What is the simplest way to determine from a DATE the prior month number?

eg Using European Date format
1/03/2005 would give 2 as the prior month
10/01/2005 would give 12


--
Cheers
Nigel






Ron Rosenfeld

Date Management
 
On Fri, 11 Mar 2005 13:41:18 -0000, "Nigel"
wrote:

Hi All
What is the simplest way to determine from a DATE the prior month number?

eg Using European Date format
1/03/2005 would give 2 as the prior month
10/01/2005 would give 12


With the date in A1 (as an Excel date; the format is irrelevant):

=MONTH(A1-DAY(A1))

should do it.


--ron

Nigel

Date Management
 
Thanks for the replies

--
Cheers
Nigel



"Ron Rosenfeld" wrote in message
...
On Fri, 11 Mar 2005 13:41:18 -0000, "Nigel"
wrote:

Hi All
What is the simplest way to determine from a DATE the prior month number?

eg Using European Date format
1/03/2005 would give 2 as the prior month
10/01/2005 would give 12


With the date in A1 (as an Excel date; the format is irrelevant):

=MONTH(A1-DAY(A1))

should do it.


--ron





All times are GMT +1. The time now is 10:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com