+ Reply to Thread
Results 1 to 15 of 15

Removing White Space in a Cell

  1. #1
    Registered User
    Join Date
    02-18-2010
    Location
    cork, ireland
    MS-Off Ver
    Excel 2003
    Posts
    15

    Removing White Space in a Cell

    Hi all,

    I have data generated from a simulator package I use (attached in a workbook). It gives me the cdf for 4 different schemes (entitled GHLS1 non perf, GHLS 09.5, GHLS 0.25 and MBLS). From the simulator software I know what the CDF should look like (also attached) but I need to graph the CDF in excel. As you'll see from the attached workbook, when I directly graph this with a scatter plot, it doesn't plot the data correctly. I suspect I must manipulate the dataset in some way.

    Any clues?

    Thanks in advance.

    cdf.gif
    Attached Files Attached Files
    Last edited by kerrymaid; 08-11-2013 at 03:53 PM.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Cdf

    Hi,

    It is difficult to answer your question as the data for the chart in the attached is contained in different workbooks; as such, it is not possible to analyse this data and to therefore potentiallly rule it out as a cause.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    02-18-2010
    Location
    cork, ireland
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Cdf

    Hi XOR LX,

    Apologies. I've reattached the workbook with the links to the data updated.
    Attached Files Attached Files

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Cdf

    Hi again,

    The reason that your graphs are not plotting as you wish is that you have an enormous amount of extra spacing, non-printable characters, etc. lurking in your data, and hence Excel cannot recognise it as numerical.

    This is the reason that your x-axis is defaulting to a maximum value of 267, since that it is the number of data points in the largest of your 4 sets (mbls). In effect, Excel is by defaut replacing your true x-axis values with 1, 2, 3, ..., 267.

    I'm not sure of the exact export set-up that you have from this simulator package of yours, but you need to make amendments, either by defining the output format prior to exporting (ideal), or, if this is not possible, then, once exported to Excel, performing a comprehensive clean-up operation on the data (removing extra spacing and non-printable characters, making sure data is formatted as numerical, etc., etc.)

    I did this for one of your four datasets (unfortunately I'm not willing to do it all for you!) and the plot was as you would expect (i.e. identical to that in your picture).

    Hope that helps and best of luck!

    Regards

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Cdf

    @kerrymaid,

    Administrative Note:
    • We would love to continue to help you with your query, but first, before we can proceed…
    • Please see Forum Rule #1 about proper thread titles and adjust accordingly...
    HTH
    Regards, Jeff

  6. #6
    Registered User
    Join Date
    02-18-2010
    Location
    cork, ireland
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Cdf

    Hi XOR LX,

    Thanks for the reply - makes sense!

    Two quick questions on the cleaning:

    I manually removed the non printable 'E' character and changed the format of all the cells to number. I must remove the spacing before each number.

    1. I tried to use the trim() function as well as find replace (find ' ', a space character and leaving replace empty) but neither have worked. What method did you use to remove the white space?
    2. Is there anything else I've omitted that you did in order to get a clean dataset?

    Thanks again.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Cdf

    Kerrymaid....

    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore requests by Administrators, Moderators and senior forum members regarding forum rules.

    If you are unclear about the request or instruction then send a private message to them asking for clarification. Do not post a reply in a thread where a moderator has requested an action that has not yet been complied with e.g Title change or Code tags...etc
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  8. #8
    Registered User
    Join Date
    02-18-2010
    Location
    cork, ireland
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Cdf

    Hi everyone,

    Sorry I didn't intentionally ignore any request. I didn't see the request when I sent the reply. I updated the thread title a moment ago so hopefully it's amended.
    Appreciate the help so far

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Removing White Space in a Cell

    Hi,

    Ok - now that that's sorted, I'm pretty sure we can get rid of all this in one go, so try this:

    Open the Find and Replace box. In the Find what: box, hold down the ALT key and type 0160 on the numeric keypad (not the number keys above the letters). Leave the Replace with: box blank. Click on Replace All.

    With any luck that should clean everything up (your graphs might even be correct after that).

    Regards

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Removing White Space in a Cell

    Another way to get CHAR(160) is to type this in the formila bar, and press f9 not Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Copy the formula bar result to Find/Replace.
    Last edited by Marcol; 08-11-2013 at 05:08 PM.

  11. #11
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Removing White Space in a Cell

    @Marcol

    Nice! Never thought of doing it that way.

  12. #12
    Registered User
    Join Date
    02-18-2010
    Location
    cork, ireland
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Removing White Space in a Cell

    @ XOR LX, Marcol - Thanks for all your help. The second solution solved it and I have now have the correct CDF

  13. #13
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Removing White Space in a Cell

    Glad we could help!

  14. #14
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Removing White Space in a Cell

    It's also handy way to check part of a formula inline, just remember to press undo after you have checked the result.

    e.g.
    Put some numbers in column A

    Then in B2
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Select the MATCH() in the formula bar press f9 and the formula will read with the last row number inline.
    Last edited by Marcol; 08-11-2013 at 05:45 PM.

  15. #15
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Removing White Space in a Cell

    @Marcol

    Perhaps you should have a go at coming up with a more technical explanation than I did for this phenomenon, then?

    http://www.excelforum.com/excel-form...ng-result.html

    Regards

+ 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