Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default 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






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default 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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default 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





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time management OKY Excel Worksheet Functions 1 June 22nd 09 06:10 PM
Project Management Radiate Excel Discussion (Misc queries) 1 October 9th 06 02:53 PM
Project Management - Start & End Date Calculations Jean McC Excel Worksheet Functions 4 June 24th 06 10:58 AM
Text Management Sprite8 Excel Discussion (Misc queries) 2 January 3rd 06 06:36 PM
Inventory Management Newtonboy Excel Discussion (Misc queries) 5 January 3rd 06 06:01 AM


All times are GMT +1. The time now is 07:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"