Add hyphens to a number

T

texasphil

In one column, each cell has a 16 digit number. I need to put hyphens
between 4 different numbers in each cell. Each cell/number will have
the hyphen in the same place. I was successful doing this once I
believe through Format\Cells\Number\Custom but I did not write down the
steps how to do it.
Any clues?

Thanks

texasphil
 
D

Dave Peterson

You didn't use format|cells|number|custom with that 16 digit number.

Excel only stores 15 significant digits. The one's digit in any 16 digit number
will be 0.

But you could store the 16 digit "number" as text--either by preceding the data
entry with an apostrophe:

'1234123412341234

or by preformatting the cell (or range of cells) as text
Format|Cells|number tab|Text

Then if you have a 16 character "number" in A1, you could use this formula in
B1:

=left(a1,4)&"-"&mid(a1,5,4)&"-"&mid(a1,9,4)&"-"&right(a1,4)

To get the look that you want.
 

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

Top