ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Adding hyphen within a set of numbers (https://www.excelbanter.com/excel-discussion-misc-queries/233830-adding-hyphen-within-set-numbers.html)

Jacqueline[_2_]

Adding hyphen within a set of numbers
 
Hi all,

I usually face set of numbers that consists of 9 numbers. E.g
123456789, 987654321.

I'm figuring how to add a hyphen between the 8th and 9th character
which will enable the numbers to look something like 12345678-9,
98765432-1. The set of numbers of cos varies day to day.

Pls help. Appreciate if anyone could enlighten me. =))

David Biddulph[_2_]

Adding hyphen within a set of numbers
 
=LEFT(A1,8)&"-"&RIGHT(A1)
--
David Biddulph

Jacqueline wrote:
Hi all,

I usually face set of numbers that consists of 9 numbers. E.g
123456789, 987654321.

I'm figuring how to add a hyphen between the 8th and 9th character
which will enable the numbers to look something like 12345678-9,
98765432-1. The set of numbers of cos varies day to day.

Pls help. Appreciate if anyone could enlighten me. =))




Rick Rothstein

Adding hyphen within a set of numbers
 
Do you need to physically change the values to include the hyphen or would
simply leaving the number as is and displaying it with the hyphen be okay
(that is, the cell value would still be 123456789, but it would display as
12345678-9)? If this would be alright, then just Custom Format
(Format/Cells/Custom from the menu bar) using 00000000-0 as the custom
format Type pattern.

--
Rick (MVP - Excel)


"Jacqueline" wrote in message
...
Hi all,

I usually face set of numbers that consists of 9 numbers. E.g
123456789, 987654321.

I'm figuring how to add a hyphen between the 8th and 9th character
which will enable the numbers to look something like 12345678-9,
98765432-1. The set of numbers of cos varies day to day.

Pls help. Appreciate if anyone could enlighten me. =))




All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com