I joined both of your formula as
=TEXT((DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))),"mm-mmmm-yyyy")
This works. Thanks very Much...
1] The following formula will give wrong results :
=TEXT((DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))),"mm-mmmm-yyyy")
Here is the Testing :
2] In Column A, all date were end of the month,
In Column B B2, enter formula and copy down:
=DATE(YEAR(A2),MONTH(A2)-1,DAY(A2))
In Column C C2, enter formula and copy down:
=TEXT(B2,"mm-mmmm-yyyy")
Results appeared wrongly at the month of March, May, July, October and December. (as highlighted in red color at the above picture)
3] Reason of the wrong result.
Example, in the month of March 2017 :
In A4 : 31/03/2017
In B4, formula :
=DATE(YEAR(A4),MONTH(A4)-1,DAY(A4))
>>
=DATE(YEAR(0+"31/03/2017"),MONTH(0+"31/03/2017")-1,DAY(0+"31/03/2017"))
>>
=DATE(2017,3-1,31)
>>
=DATE(2017,2,31)
>>
=03/03/2017 -->> Wrong result !
4] Using Khalid's formula in post #.10 + Text function
In Column E E2, enter formula and copy down:
=TEXT(EDATE(A2,-1),"mm-mmmm-yyy")
All results appeared correct.
5] See attached file.
Regards
Bosco