Hello people
I got this string "2015-07-22"
but I just want to have 07
Could someone help me with a code?
Thank you in advance
Hello people
I got this string "2015-07-22"
but I just want to have 07
Could someone help me with a code?
Thank you in advance
This is how I arrived at a solution but then I tend to do things backwards.... Assuming the string is in A1 and formula is in A2
=Right(Left(A1,7), 2)
Others though would use the Mid function
=Mid(A1,6,2)
Which Excel would prefer.
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
Looks very much like a date.
=MONTH(A1)
If it is text, try
=TRIM(MID(SUBSTITUTE(A1,"-",REPT(" ",999)),999,999))
Where you have "07", it can be any length between "-"'s
If it is a date, then use =Text in a UDF or Format() in a VBA solution. For the former: =TEXT(A1, "MM")