Superscript in custom format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have started to use custom formats to display units. For instance when I
want a number to display as 24" or 58.2 lbf. I don't know if this is the
proper way to do this, but it works great for me. The problem is I want one
to display as 28in2 where the 2 is a superscript. Currently I have the
output in one cell and the next cell is text "in2" with the "2" superscripted
to signify inches squared. I would like a solution where I could combine the
two cells into one cell that is still treated as a number when referencing
from other cells.
 
Sloth

Use custom formatting on the numbers.

i.e. Format>Cells>Custom.

Enter 0" in" then hold ALT Key and hit 0178 on number pad at right side of
keyboard.

No need for the extra cells. Can all be done in one cell and the 28 remains
as a number.

If you can use a macro it is possible to select a great whack of cells and
just hit a button.

Sub sq_inches()
Selection.NumberFormat = "0"" in" & Chr(178) & """"
'0179 for cubic inches
End Sub


Gord Dibben Excel MVP
 
That's pretty clever. I didn't even think to use symbols. Now I can make
in² and in³ but what about in4? Any ideas? That is pretty much all I need
except for maybe in-1. Thanks for the input
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top