custom number format code using letters and numbers

  • Thread starter Thread starter Foo Foo Daddy
  • Start date Start date
F

Foo Foo Daddy

How can I format my cell to display letters, a dash, then #s? For example:
ABC-12345678, or 2DE-12347562, or FG3-46518673?
 
Hi,
Let's say in column A you have your letters and in column B your numbers
then in column C enter

=A1&"-"&B1

copy formula down

if this helps please click yes, thanks
 
Number format applies to numbers.

You could type your entry in one column and use a formula in another.

=left(a1,3)&"-"&mid(a1,4,255)

(255 is a big number large enough to retrieve that last portion)
 
On Mon, 17 Aug 2009 07:26:01 -0700, Foo Foo Daddy <Foo Foo
How can I format my cell to display letters, a dash, then #s? For example:
ABC-12345678, or 2DE-12347562, or FG3-46518673?

Without using VBA, your custom format can only hard-code the letters. You
could use up to three conditions related to the number value to decide which
letters to use.

e.g.

Format/Cells/Number/Custom Type:

"ABC-"00000000

or

"2DE-"00000000

You would enter only the 8 digits and the value would look like the above.

If you want to be able to enter the entire string, and have it appear formatted
as above, you could either use a helper column to display your results in
another column e.g. =left(a1,3)&"-"&mid(a1,4,8) Or use a VBA macro to do the
same thing "in situ"
--ron
 
Back
Top