I think that might be overkill, although I'm sure there is a formula to do it. Have you checked the Excel cell formatting feature? I doubt you even need a formula, just the desired display format.
I have always configured, to the extent supported, my DOS and Windows software to display time using a 24 hour format. I also display dates as YYYY/MM/DD, which works well for sorting. The benefit of this is that you can see the format you wish everywhere, not just in Excel. (But I do still use a desktop gadget which displays a small analog 12-hr clockface). Occasionally I get CSV data with the date in a different format which causes some trouble, but the setting can easily be changed long enough to perform an import.