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
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
=MONTH(DATE(YEAR(A1),MONTH(A1)-1,1))
--
Kind Regards,
Niek Otten
Microsoft MVP - Excel
"Nigel" <[email protected]> wrote in message
news:[email protected]...
> 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
>
>
>
>
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
>
>
>
>
>
On Fri, 11 Mar 2005 13:41:18 -0000, "Nigel" <[email protected]>
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
Thanks for the replies
--
Cheers
Nigel
"Ron Rosenfeld" <[email protected]> wrote in message
news:[email protected]...
> On Fri, 11 Mar 2005 13:41:18 -0000, "Nigel" <[email protected]>
> 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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks