+ Reply to Thread
Results 1 to 5 of 5

Copying numbers from HTML table into Excel: How to make them numbers, not text?

  1. #1
    Registered User
    Join Date
    12-31-2008
    Location
    Alaska, (not Anchorage)
    MS-Off Ver
    Excel 2010, 2016, and 365
    Posts
    78

    Copying numbers from HTML table into Excel: How to make them numbers, not text?

    I occasionally have to copy a table from a webpage into Excel. When I do I find that I am often unable to manipulate the numbers as numbers. Right clicking on one of these cells (for example A1) and selecting "Format Cells..." I can see that "General" format is selected. I change this to "Number", select "0" for decimal places and check the "Use 1000 separator" box. Select "Okay" to close the window. However, now when I go to a blank cell (B1) and type =A1/1 I get "#VALUE!" error message.

    What is the easiest way to resolve this?

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Copying numbers from HTML table into Excel: How to make them numbers, not text?

    For some reason, copying data from HTML often carries non-printing characters with the data. The usual solutions that I see involve:
    1) Locating the offending characters.
    2) Removing those characters from the value.

    The TRIM() and CLEAN() functions can be useful, but they don't work for all non-printing characters that can show up. Sometimes you can identify the character and use a Find-Replace command.

    I find that I usually start this sort of thing with a LEN() function to see how long the text string is. I will often follow this up with a UNICODE(MID()) function to identify each character's code number, so that I know what to look for. From there, try to identify the patterns that will allow me to extract the numbers from the extraneous characters and convert them to numbers (usually using a VALUE() function).
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    12-31-2008
    Location
    Alaska, (not Anchorage)
    MS-Off Ver
    Excel 2010, 2016, and 365
    Posts
    78

    Re: Copying numbers from HTML table into Excel: How to make them numbers, not text?

    Thanks. In the past I'd solved this w/a variety of Rube Goldberg methods, (=SUBSTITUTE(A1," ","") but none seem to completely do the trick. I still end up doing a lot of hand entering.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Copying numbers from HTML table into Excel: How to make them numbers, not text?

    You often get the non-breaking space character (code = 160) when copying data from HTML tables. A quick way of getting rid of them is to highlight all the data then do CTRL-H (Find & Replace) and:

    Find what: ALT-0160
    Replace with: (leave blank)
    Click Replace All

    where ALT-0160 mean to hold down the Alt key and type the digits 0160 on the numeric keypad, then release Alt. Do not use the number keys running across the top of the keyboard. That will usually convert the text-numbers to proper numbers.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    12-31-2008
    Location
    Alaska, (not Anchorage)
    MS-Off Ver
    Excel 2010, 2016, and 365
    Posts
    78

    Re: Copying numbers from HTML table into Excel: How to make them numbers, not text?

    Quote Originally Posted by Pete_UK View Post
    You often get the non-breaking space character (code = 160) when copying data from HTML tables. A quick way of getting rid of them is to highlight all the data then do CTRL-H (Find & Replace) and:

    Find what: ALT-0160
    Replace with: (leave blank)
    Click Replace All

    where ALT-0160 mean to hold down the Alt key and type the digits 0160 on the numeric keypad, then release Alt. Do not use the number keys running across the top of the keyboard. That will usually convert the text-numbers to proper numbers.

    Hope this helps.

    Pete
    Thanks Pete. That nailed it AFTER I disengaged the keyboard NUM LOCK key. Best regards.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] make Userform entries with just numbers stay as text and not numbers upon pasting
    By vpan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-01-2016, 02:13 PM
  2. Replies: 19
    Last Post: 07-20-2014, 04:55 PM
  3. Need help copying text from HTML Table
    By aliu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-02-2013, 10:13 AM
  4. Copying from HTML Table then Pasting into Excel
    By Editz in forum Excel General
    Replies: 2
    Last Post: 01-18-2007, 07:33 AM
  5. Convert numbers stored as text to numbers Excel 2000
    By Darlene in forum Excel General
    Replies: 6
    Last Post: 01-31-2006, 04:10 PM
  6. [SOLVED] How to convert Excel imported numbers from text to numbers?
    By Alden in forum Excel General
    Replies: 9
    Last Post: 04-01-2005, 05:06 PM
  7. [SOLVED] How can I make Excel display HTML code as text
    By roopytoopdongle in forum Excel General
    Replies: 1
    Last Post: 03-20-2005, 03:07 AM

Tags for this Thread

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