+ Reply to Thread
Results 1 to 5 of 5

data looks same but showing different when using formula

  1. #1
    Forum Contributor
    Join Date
    07-22-2008
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2007
    Posts
    130

    data looks same but showing different when using formula

    Can anyone help telling me what is the difference between two data? I checked carefully but failed to find out. Thank you in advance for solution.
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: data looks same but showing different when using formula

    hi sumonrezadu. the difference is the space. A1 contains a normal space while A2 has a non-breaking space. to change or compare, you can use:
    =SUBSTITUTE(A1,CHAR(160)," ")
    or
    =SUBSTITUTE(A1,CHAR(160),CHAR(32))

    you can have a good read here:
    http://en.wikipedia.org/wiki/Non-breaking_space

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

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

    Re: data looks same but showing different when using formula

    Although they both appear to have a space between the two names, the first one has a normal space character (code 32), whereas the second one has the non-breaking space character (code 160), so they are not the same. You can use this formula in B1 to change code 160 to code 32:

    =SUBSTITUTE(A1,CHAR(160),CHAR(32))

    and copy this into cell B2, then when you use:

    =B2=B1

    this will return TRUE.

    Hope this helps.

    Pete

  4. #4
    Forum Contributor
    Join Date
    07-22-2008
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2007
    Posts
    130

    Re: data looks same but showing different when using formula

    Many many thanks for your help. But the question is how will I solve the problem easily when I get lots of similar data in a column. Each space may be different from other space. This is just one example. How will I solve other pairs in which spaces may be different from the data I attached here? What is the difference between normal space and non-breaking space?

  5. #5
    Forum Contributor
    Join Date
    07-22-2008
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2007
    Posts
    130

    Re: data looks same but showing different when using formula

    Thank you very much. Now I fully understand. I thought there could be various types of spaces. Since there are only 2 types of spaces, my problem is completely solved. Thanks again.

+ 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