ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Return double digit month (https://www.excelbanter.com/excel-programming/326754-return-double-digit-month.html)

quartz[_2_]

Return double digit month
 
Is there a way to return a two digit month using the MONTH function? i.e. 01,
02, 03, 04, etc.

For example, when I try: Format(Month(dteDate), "MM")

It does not return the correct month...how can I get at this? I'm sure I
know how to do this, but it's a Monday and I'm dragging...

Thanks much in advance.

Bernie Deitrick

Return double digit month
 

Format(Month(dteDate), "00")

HTH,
Bernie
MS Excel MVP


"quartz" wrote in message
...
Is there a way to return a two digit month using the MONTH function? i.e.

01,
02, 03, 04, etc.

For example, when I try: Format(Month(dteDate), "MM")

It does not return the correct month...how can I get at this? I'm sure I
know how to do this, but it's a Monday and I'm dragging...

Thanks much in advance.




Niek Otten

Return double digit month
 
If dteDate is a real date, just use Format(dteDate,"mm")

--

Kind Regards,

Niek Otten

Microsoft MVP - Excel

"quartz" wrote in message
...
Is there a way to return a two digit month using the MONTH function? i.e.
01,
02, 03, 04, etc.

For example, when I try: Format(Month(dteDate), "MM")

It does not return the correct month...how can I get at this? I'm sure I
know how to do this, but it's a Monday and I'm dragging...

Thanks much in advance.





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

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