When formatting a cell in Excel (or LibreOffice), how can I have a certain symbol displayed in a specified position?
For instance, I want a cell formatted so that the sixth symbol is a hyphen, eg. "2121D-34".
It looks like you can't do what you're you're asking. If your data was purely numerical, a Custom Cell Format of "#####-##" would work fine (displaying "1234567" as "12345-67"). However, as soon as you involve a non-numeric character (e.g. the "D" in your example), this no longer works. One source I found states that, when it comes to formatting cells in Excel, "there is not an awful lot more you can do with text".
I haven't used LibreOffice, but their help wiki shows that your results there will likely be similar, with plenty of numerical formats but few (if any) text formats available.
From the Excel 'Format Cells' dialog:
A work-around is to use a helper column that some text formulas. Using your example,
will return your data formatted the way you want. If your base data varies, then you'll have to get a little more sophisticated in your formula.