Question about custom number format in Excel

I like to use custom number formatting in Excel to append units to measurement data. As an example, I would use the following custom format to append the letter m (for meters) to a number:

0.0" m"

But let’s say the units were something a bit more complex, like m[sup]4[/sup] kg[sup]-2[/sup]. Is there a way to do this using custom formatting?

If you have a font with the special characters you need then using the custom number format as you already have but using ALT+unicode will work

(ie ALT+253 say for ² )

What if the exponent varies?

thats why I had to say if you had a font with the symbol you want

¹³² are ALT+251 ALT+252 AND ALT+253 in many fonts

I’m just looking around to see if i can resolve the issue in a better way

Hopefully someone will come along who knows a better solution

Do you just need sub- and superscripts? If so, you can highlight the text you want to change, right click, select Format Cells, and then check Subscript or Superscript (under Effects). It’ll only alter the text you highlighted.

(ETA: Just to be clear, for your example, you’d just type “m4kg-2”, highlight the 4 and do the above, then repeat for the -2.)

This works with regular 'ol text in cells. But it doesn’t work custom number formatting.