Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
=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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Time management | Excel Worksheet Functions | |||
Project Management | Excel Discussion (Misc queries) | |||
Project Management - Start & End Date Calculations | Excel Worksheet Functions | |||
Text Management | Excel Discussion (Misc queries) | |||
Inventory Management | Excel Discussion (Misc queries) |