+ Reply to Thread
Results 1 to 5 of 5

Formula or Function to Set Many Existing Numbers in Same Format?

  1. #1
    V. Hatherley
    Guest

    Formula or Function to Set Many Existing Numbers in Same Format?

    I have a column of numbers in the following format:

    X-XX-XXXXXX-X

    That is, they're all ten-digit numbers with hyphens in the positions shown.
    Or rather, they all SHOULD be like that. Unfortunately, they've been keyed in
    by many different people, and sometimes the hyphens have been left out, so
    the number looks like this:

    XXXXXXXXXX

    Is there a way to automate the insertion of the hyphens so I don't have to
    do many hundreds of them manually? It would need to be a method I could use
    on the column as a whole (and that wouldn't screw up the correct numbers),
    because the improperly-formatted numbers are scattered through, and if I have
    to select only the incorrect ones to fix, I won't really be saving much time.

    Help! Thanks as always!


  2. #2
    V. Hatherley
    Guest

    RE: Formula or Function to Set Many Existing Numbers in Same Forma

    Hmm. I'm not sure this is going to work. I can use the Find and Replace
    feature to find the hyphenated numbers like you suggest by putting

    ?-??-??????-?

    in the "Find" field, but I would need to replace the number in each cell
    with a non-hyphenated version of the number already in the cell, which I
    don't think I can automated using the replace feature. Am I just missing
    something?

    "Sloth" wrote:

    > I would delete all the hyphens using the find replace function (put - in find
    > and nothing in replace). Then you can use a custom number format like this
    >
    > 0-00-000000-0
    >
    > this would make every cell look the same. The value of each cell will be a
    > 10 digit number, but they will look the way you want when viewing and
    > printing.
    >
    > Save your work before trying this.
    >
    > "V. Hatherley" wrote:
    >
    > > I have a column of numbers in the following format:
    > >
    > > X-XX-XXXXXX-X
    > >
    > > That is, they're all ten-digit numbers with hyphens in the positions shown.
    > > Or rather, they all SHOULD be like that. Unfortunately, they've been keyed in
    > > by many different people, and sometimes the hyphens have been left out, so
    > > the number looks like this:
    > >
    > > XXXXXXXXXX
    > >
    > > Is there a way to automate the insertion of the hyphens so I don't have to
    > > do many hundreds of them manually? It would need to be a method I could use
    > > on the column as a whole (and that wouldn't screw up the correct numbers),
    > > because the improperly-formatted numbers are scattered through, and if I have
    > > to select only the incorrect ones to fix, I won't really be saving much time.
    > >
    > > Help! Thanks as always!
    > >


  3. #3
    Sloth
    Guest

    RE: Formula or Function to Set Many Existing Numbers in Same Forma

    Under Find enter a hyphen, and leave it blank under replace. Click "replace
    all". This will delete all hyphens automatically, turning every cell into a
    10 digit number. The custom format will then change the "look" of the values
    in the cells and make them look the way you want.

    "V. Hatherley" wrote:

    > Hmm. I'm not sure this is going to work. I can use the Find and Replace
    > feature to find the hyphenated numbers like you suggest by putting
    >
    > ?-??-??????-?
    >
    > in the "Find" field, but I would need to replace the number in each cell
    > with a non-hyphenated version of the number already in the cell, which I
    > don't think I can automated using the replace feature. Am I just missing
    > something?
    >
    > "Sloth" wrote:
    >
    > > I would delete all the hyphens using the find replace function (put - in find
    > > and nothing in replace). Then you can use a custom number format like this
    > >
    > > 0-00-000000-0
    > >
    > > this would make every cell look the same. The value of each cell will be a
    > > 10 digit number, but they will look the way you want when viewing and
    > > printing.
    > >
    > > Save your work before trying this.
    > >
    > > "V. Hatherley" wrote:
    > >
    > > > I have a column of numbers in the following format:
    > > >
    > > > X-XX-XXXXXX-X
    > > >
    > > > That is, they're all ten-digit numbers with hyphens in the positions shown.
    > > > Or rather, they all SHOULD be like that. Unfortunately, they've been keyed in
    > > > by many different people, and sometimes the hyphens have been left out, so
    > > > the number looks like this:
    > > >
    > > > XXXXXXXXXX
    > > >
    > > > Is there a way to automate the insertion of the hyphens so I don't have to
    > > > do many hundreds of them manually? It would need to be a method I could use
    > > > on the column as a whole (and that wouldn't screw up the correct numbers),
    > > > because the improperly-formatted numbers are scattered through, and if I have
    > > > to select only the incorrect ones to fix, I won't really be saving much time.
    > > >
    > > > Help! Thanks as always!
    > > >


  4. #4
    V. Hatherley
    Guest

    RE: Formula or Function to Set Many Existing Numbers in Same Forma

    Oh, got it. Sorry about the stupidity--thanks for the help! I think this will
    work!

    "Sloth" wrote:

    > Under Find enter a hyphen, and leave it blank under replace. Click "replace
    > all". This will delete all hyphens automatically, turning every cell into a
    > 10 digit number. The custom format will then change the "look" of the values
    > in the cells and make them look the way you want.
    >
    > "V. Hatherley" wrote:
    >
    > > Hmm. I'm not sure this is going to work. I can use the Find and Replace
    > > feature to find the hyphenated numbers like you suggest by putting
    > >
    > > ?-??-??????-?
    > >
    > > in the "Find" field, but I would need to replace the number in each cell
    > > with a non-hyphenated version of the number already in the cell, which I
    > > don't think I can automated using the replace feature. Am I just missing
    > > something?
    > >
    > > "Sloth" wrote:
    > >
    > > > I would delete all the hyphens using the find replace function (put - in find
    > > > and nothing in replace). Then you can use a custom number format like this
    > > >
    > > > 0-00-000000-0
    > > >
    > > > this would make every cell look the same. The value of each cell will be a
    > > > 10 digit number, but they will look the way you want when viewing and
    > > > printing.
    > > >
    > > > Save your work before trying this.
    > > >
    > > > "V. Hatherley" wrote:
    > > >
    > > > > I have a column of numbers in the following format:
    > > > >
    > > > > X-XX-XXXXXX-X
    > > > >
    > > > > That is, they're all ten-digit numbers with hyphens in the positions shown.
    > > > > Or rather, they all SHOULD be like that. Unfortunately, they've been keyed in
    > > > > by many different people, and sometimes the hyphens have been left out, so
    > > > > the number looks like this:
    > > > >
    > > > > XXXXXXXXXX
    > > > >
    > > > > Is there a way to automate the insertion of the hyphens so I don't have to
    > > > > do many hundreds of them manually? It would need to be a method I could use
    > > > > on the column as a whole (and that wouldn't screw up the correct numbers),
    > > > > because the improperly-formatted numbers are scattered through, and if I have
    > > > > to select only the incorrect ones to fix, I won't really be saving much time.
    > > > >
    > > > > Help! Thanks as always!
    > > > >


  5. #5
    Gord Dibben
    Guest

    Re: Formula or Function to Set Many Existing Numbers in Same Forma

    Just be aware that any leading zeros will be lost with this method.

    i.e. 0-00-123456-7 will turn into 1234567 when you replace the hyphens with
    nothing.


    Gord Dibben MS Excel MVP


    On Wed, 16 Aug 2006 10:03:01 -0700, V. Hatherley
    <[email protected]> wrote:

    >Oh, got it. Sorry about the stupidity--thanks for the help! I think this will
    >work!
    >
    >"Sloth" wrote:
    >
    >> Under Find enter a hyphen, and leave it blank under replace. Click "replace
    >> all". This will delete all hyphens automatically, turning every cell into a
    >> 10 digit number. The custom format will then change the "look" of the values
    >> in the cells and make them look the way you want.
    >>
    >> "V. Hatherley" wrote:
    >>
    >> > Hmm. I'm not sure this is going to work. I can use the Find and Replace
    >> > feature to find the hyphenated numbers like you suggest by putting
    >> >
    >> > ?-??-??????-?
    >> >
    >> > in the "Find" field, but I would need to replace the number in each cell
    >> > with a non-hyphenated version of the number already in the cell, which I
    >> > don't think I can automated using the replace feature. Am I just missing
    >> > something?
    >> >
    >> > "Sloth" wrote:
    >> >
    >> > > I would delete all the hyphens using the find replace function (put - in find
    >> > > and nothing in replace). Then you can use a custom number format like this
    >> > >
    >> > > 0-00-000000-0
    >> > >
    >> > > this would make every cell look the same. The value of each cell will be a
    >> > > 10 digit number, but they will look the way you want when viewing and
    >> > > printing.
    >> > >
    >> > > Save your work before trying this.
    >> > >
    >> > > "V. Hatherley" wrote:
    >> > >
    >> > > > I have a column of numbers in the following format:
    >> > > >
    >> > > > X-XX-XXXXXX-X
    >> > > >
    >> > > > That is, they're all ten-digit numbers with hyphens in the positions shown.
    >> > > > Or rather, they all SHOULD be like that. Unfortunately, they've been keyed in
    >> > > > by many different people, and sometimes the hyphens have been left out, so
    >> > > > the number looks like this:
    >> > > >
    >> > > > XXXXXXXXXX
    >> > > >
    >> > > > Is there a way to automate the insertion of the hyphens so I don't have to
    >> > > > do many hundreds of them manually? It would need to be a method I could use
    >> > > > on the column as a whole (and that wouldn't screw up the correct numbers),
    >> > > > because the improperly-formatted numbers are scattered through, and if I have
    >> > > > to select only the incorrect ones to fix, I won't really be saving much time.
    >> > > >
    >> > > > Help! Thanks as always!
    >> > > >



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1