Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I just asked here how to do the opposite. How do I convert "May" to 5
without using a case statement? I've looked all over on the net, but can't find this specific thing. Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 24 Mar 2009 15:44:22 -0600, salgud
wrote: I just asked here how to do the opposite. How do I convert "May" to 5 without using a case statement? I've looked all over on the net, but can't find this specific thing. Thanks in advance. Try this worksheet formula: =SUMPRODUCT(ROW(1:12)*(TEXT(DATE(,ROW(1:12),1),"MM M")="May")) Hope this helps / Lars-Åke |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Tue, 24 Mar 2009 22:03:30 GMT, Lars-Åke Aspelin wrote:
On Tue, 24 Mar 2009 15:44:22 -0600, salgud wrote: I just asked here how to do the opposite. How do I convert "May" to 5 without using a case statement? I've looked all over on the net, but can't find this specific thing. Thanks in advance. Try this worksheet formula: =SUMPRODUCT(ROW(1:12)*(TEXT(DATE(,ROW(1:12),1),"MM M")="May")) Hope this helps / Lars-Åke Sorry, should have been clear I want to do this in VBA, not in the spreadsheet. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Debug.Print Month(CVDate(tMth & "-1-2000"))
-- Steve "salgud" wrote in message ... On Tue, 24 Mar 2009 22:03:30 GMT, Lars-Åke Aspelin wrote: On Tue, 24 Mar 2009 15:44:22 -0600, salgud wrote: I just asked here how to do the opposite. How do I convert "May" to 5 without using a case statement? I've looked all over on the net, but can't find this specific thing. Thanks in advance. Try this worksheet formula: =SUMPRODUCT(ROW(1:12)*(TEXT(DATE(,ROW(1:12),1),"MM M")="May")) Hope this helps / Lars-Åke Sorry, should have been clear I want to do this in VBA, not in the spreadsheet. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Forgot to add tMth is your text month.
-- Steve "AltaEgo" <Somewhere@NotHere wrote in message ... Debug.Print Month(CVDate(tMth & "-1-2000")) -- Steve "salgud" wrote in message ... On Tue, 24 Mar 2009 22:03:30 GMT, Lars-Åke Aspelin wrote: On Tue, 24 Mar 2009 15:44:22 -0600, salgud wrote: I just asked here how to do the opposite. How do I convert "May" to 5 without using a case statement? I've looked all over on the net, but can't find this specific thing. Thanks in advance. Try this worksheet formula: =SUMPRODUCT(ROW(1:12)*(TEXT(DATE(,ROW(1:12),1),"MM M")="May")) Hope this helps / Lars-Åke Sorry, should have been clear I want to do this in VBA, not in the spreadsheet. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Fri, 27 Mar 2009 09:42:11 +1100, AltaEgo wrote:
Forgot to add tMth is your text month. Thanks for trying, but that formula doesn't work, it always returns Jan. Any other suggestions? |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is one way:
=CHOOSE(MATCH(A1,{"Jan";"Feb";"Mar";"Apr";"May"},1 ),"1","2","3","4","5") Another way: =LOOKUP(A17,{"Jan","Feb","Mar","Apr","May"},{"1"," 2","3","4","5"}) HTH, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "salgud" wrote: I just asked here how to do the opposite. How do I convert "May" to 5 without using a case statement? I've looked all over on the net, but can't find this specific thing. Thanks in advance. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way
mymonthnum = Month(DateValue(Range("i2") & " 1,2009")) -- Don Guillett Microsoft MVP Excel SalesAid Software "salgud" wrote in message .. . I just asked here how to do the opposite. How do I convert "May" to 5 without using a case statement? I've looked all over on the net, but can't find this specific thing. Thanks in advance. |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
strMonth = "May"
intMonth = Month("01-" & strMonth & "-" & Year(Date)) If this post helps click Yes --------------- Jacob Skaria "salgud" wrote: I just asked here how to do the opposite. How do I convert "May" to 5 without using a case statement? I've looked all over on the net, but can't find this specific thing. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
convert date to text month | Excel Discussion (Misc queries) | |||
Function or formula to convert "text" month to number of month? | Excel Discussion (Misc queries) | |||
Converting Month Number to Month Text Abbreviation | Excel Worksheet Functions | |||
Function or formula to convert "text" month to number of month? | Excel Discussion (Misc queries) | |||
Function or formula to convert "text" month to number of month | Excel Discussion (Misc queries) |