I don't know what you mean by "dynamically".

If it is from a SQL query and gets to Excel, you can format it any way you want.