Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Month to Number format

Hi ,

I need to extract November as "11" from November 2007. But this can change
depending on the current month eg. "12" from December 2007.

"11" should be in number format so that it can be used in calculations to
calculate average costs.

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Month to Number format

Hi,
Not sure I understand it...
Say you have a full/partial date in A1
Anywhere else on the sheet, use =Month(A1) to return the month number. eg:
= IF ( Month(A1) = 11, ..., ... )

--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"manfareed" wrote:

Hi ,

I need to extract November as "11" from November 2007. But this can change
depending on the current month eg. "12" from December 2007.

"11" should be in number format so that it can be used in calculations to
calculate average costs.

Thanks,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 91
Default Month to Number format

On Dec 13, 11:40 am, manfareed
wrote:
Hi ,

I need to extract November as "11" from November 2007. But this can change
depending on the current month eg. "12" from December 2007.

"11" should be in number format so that it can be used in calculations to
calculate average costs.

Thanks,


Just use the Month() function...

Private Sub test()
Dim s As String, n As Integer
s = "November 2007"

n = Month(s)

End Sub
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Month to Number format

Hi Thank you both. That works perfectly.

"manfareed" wrote:

Hi ,

I need to extract November as "11" from November 2007. But this can change
depending on the current month eg. "12" from December 2007.

"11" should be in number format so that it can be used in calculations to
calculate average costs.

Thanks,

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
Cells shows current month only in number format Benny New Users to Excel 2 October 27th 09 06:27 PM
count month when date is in day/month/year format ccKennedy Excel Worksheet Functions 6 April 30th 09 03:32 AM
Number of days in month counted from shortened name of month & yea Tumar Excel Worksheet Functions 6 September 18th 07 03:36 PM
Converting Month Number to Month Text Abbreviation Bob Excel Worksheet Functions 10 May 12th 07 04:11 AM
How do I convert a month-date format to day number of the year? Larry Excel Worksheet Functions 2 January 11th 07 05:21 PM


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

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

About Us

"It's about Microsoft Excel"