Month to Number format

  • Thread starter Thread starter manfareed
  • Start date Start date
M

manfareed

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,
 
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, ..., ... )
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top