You don't need a formula; it's actually quite simple. If you input time is like this:
2:30 PM (with a space in the middle),
it will automatically switch your input to the 24hr equivalent. But if you input the time as 2:30pm (without a space in the middle), and THEN hit enter, it will automatically correct your input to 2:30 PM, as opposed to the military ...
(Right clicking may not be ideal when you look to automate your sheet...)
Apply method setShowHyperlink(bool) to a range of cells, e.g.
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()
var reportRange = sheet.getRange("A2:E200")
See Google documentation - Google Apps Script
Google Sheets doesn't have a built-in function that directly returns something to tell us if a cell is merged or not. Perhaps the closer function is CELL(info_type, reference) with the first parameter specifying the type of information that should be returned. Unfortunately it doesn't include an "info_type" for merged/un-merged.
On the other hand, it's a ...
The Google Sheets API documentation includes an article about Date and Number formats. According to this article, the default conditions that could be used are for negative, positive, and zero . They could be customized to something like low, high and in between but in this case, adding ordinal suffixes, this isn't enough as the rules are more complex.
This is a total kludge, but if you want to do it without an extra column in your table, you can edit the format (Format > Number > More Formats > More Time and Date Formats) and then just insert a ton of spaces after the minutes and use the column size to hide the AM/PM part.
(Hour 1)(Minutes 01)(AM/PM a) -----> (Hour 1)(Minutes 01) ...
I have noticed this several times - the plain text mode work or go to the Reply options and press Shift and pop-out the reply.
That works but still not an optimal solution if you are scanning thru many business emails, it is still a pain