Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

custom number format code using letters and numbers

1,024 views
Skip to first unread message

Foo Daddy@discussions.microsoft.com Foo Foo Daddy

unread,
Aug 17, 2009, 10:26:01 AM8/17/09
to
How can I format my cell to display letters, a dash, then #s? For example:
ABC-12345678, or 2DE-12347562, or FG3-46518673?

Eduardo

unread,
Aug 17, 2009, 10:42:02 AM8/17/09
to
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

Dave Peterson

unread,
Aug 17, 2009, 10:50:59 AM8/17/09
to
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)

Foo Foo Daddy wrote:
>
> How can I format my cell to display letters, a dash, then #s? For example:
> ABC-12345678, or 2DE-12347562, or FG3-46518673?

--

Dave Peterson

Ron Rosenfeld

unread,
Aug 17, 2009, 10:59:37 AM8/17/09
to

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

bra...@iherb.com

unread,
Dec 22, 2016, 10:20:47 AM12/22/16
to
On Monday, August 17, 2009 at 7:26:01 AM UTC-7, Foo Da...@discussions.microsoft.com Foo Foo Daddy wrote:
> How can I format my cell to display letters, a dash, then #s? For example:
> ABC-12345678, or 2DE-12347562, or FG3-46518673?

If the string of numbers after the letters is always the same legnth and the unformatted TEXT Looks like ABC12345678 you could do the following

to format ABC12345678 in Cell A1 as ABC-12345678 in Cell B1: =LEFT(A1,3)&"-"&RIGHT(A1,8)

--
*The information contained in this message is the sole and exclusive
property of **iHerb Inc.** and may be privileged and confidential. It may
not be disseminated or distributed to persons or entities other than the
ones intended without the written authority of **iHerb Inc.* *If you have
received this e-mail in error or are not the intended recipient, you may
not use, copy, disseminate or distribute it. Do not open any attachments.
Please delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.*
0 new messages