+ Reply to Thread
Results 1 to 6 of 6

Cannot sum cells - wrong format?

  1. #1
    Registered User
    Join Date
    05-23-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    7

    Cannot sum cells - wrong format?

    Hello,

    I've got a problem with SUM function. I have a document where I do that, but the data is copied from another source (webpage), it is not entered by me.
    That is the reason why I can't sum these cells, something is wrong with formatting. The question is how I can sum these cells without retyping their values (because I can easily have a thousands of rows and in that case it's hard to retype it all). Document is attached here: results.xlsx

    The solution is probably easy but it's a problem to me, I cant solve that with right click -> change format to numbers?
    Any other ways?

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,292

    Re: Cannot sum cells - wrong format?

    =LEFT(D3,1)+RIGHT(E3,1)
    Try this
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Forum Expert Tsjallie's Avatar
    Join Date
    09-15-2012
    Location
    NL
    MS-Off Ver
    2010, 2013, 2016
    Posts
    2,077

    Re: Cannot sum cells - wrong format?

    There's an (invisible) character with ascii code 160 in the cells. Probably coming along from the website.
    You can get rid of it with
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Cheers!
    Tsjallie




    --------
    If your problem is solved, pls mark the thread SOLVED (see Thread Tools in the menu above). Thank you!

    If you think design is an expensive waste of time, try doing without ...

  4. #4
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: Cannot sum cells - wrong format?

    Quote Originally Posted by Keddy44 View Post
    I've got a problem with SUM function. I have a document where I do that, but the data is copied from another source (webpage), it is not entered by me. That is the reason why I can't sum these cells, something is wrong with formatting. The question is how I can sum these cells without retyping their values (because I can easily have a thousands of rows and in that case it's hard to retype it all). Document is attached here: Attachment 396739
    The solution is probably easy but it's a problem to me, I cant solve that with right click -> change format to numbers? Any other ways?
    No, simply changing the Excel format does not remedy the problem.

    The problem is: when you copy-and-paste from a webpage, some "spaces" are actually nonbreaking spaces (HTML nbsp). Excel does not recognize that as a space.

    To remedy, put the following formula into a parallel column. For example:

    =--TRIM(SUBSTITUTE(D3,CHAR(160),""))

    SUBSTITUTE removes the nonbreaking spaces. TRIM removes any errant "real spaces" (none in your example). The double-negate converts the text result to a number.

    The cell format General might suffice. Otherwise, choose a numeric format that you desire.

    PS.... If you wish, copy the parallel column of results and paste-value over columns D and E to permanently replace the original text copy-and-pasted from the webpage.

    PPS.... I try to avoid the problem in the first place by copying from the webpage and pasting into Notepad or equivalent non-formatting text editor, then copying from Notepad and pasting into Excel.
    Last edited by joeu2004; 05-23-2015 at 03:14 PM. Reason: cosmetic; PS; PPS

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Cannot sum cells - wrong format?

    =SUMPRODUCT(SUBSTITUTE(TRIM(D3:E3),CHAR(160),"")+0)
    try this
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    05-23-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    7

    Re: Cannot sum cells - wrong format?

    Thank you, all suggestions worked well

+ 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. how to clean a wrong email format
    By marian37 in forum Excel General
    Replies: 6
    Last Post: 12-11-2014, 10:33 AM
  2. [SOLVED] Copied values are in wrong format
    By RorschachDK in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-07-2014, 11:07 AM
  3. Macro to sort merged cells with numbers in wrong format
    By adw223 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-30-2013, 09:37 AM
  4. Macro gives the wrong date format
    By chin_un_len in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2006, 08:46 PM
  5. Wrong format of database
    By Harpagornis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2005, 09:46 AM

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