+ Reply to Thread
Results 1 to 8 of 8

Replace cells and create dummy variables

  1. #1
    Registered User
    Join Date
    03-29-2012
    Location
    Santiago de Chile
    MS-Off Ver
    Excel 2007
    Posts
    36

    Replace cells and create dummy variables

    Hi,

    Once again i need help on an issue.

    1. The cells containing a dot need to be replaced by zeros. This seems to be a problem as other cells containing numbers also contain dots.
    2. Cells in column E, F and G refer to column A,B and C. Whenever there is no value in cells A,B and C i want to display a 0 for no value and a 1 for value in the respective Cells in column A,B and C respectivly. In this case F would refer to B and so on. (I did it manually to make my point clear in the file i uploaded)

    If somebody could help me on this, that would be great. Thank you very much in advance. Attached find the file
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Replace cells and create dummy variables

    CTRL + H

    find . (dot)

    replace (zero)

    and the formula in the yellow cells.
    Attached Files Attached Files

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

    Re: Replace cells and create dummy variables

    Highlight the range with the dots and run...

    Please Login or Register  to view this content.
    Now use this formula in E2 copied to the right and down.

    =IF(A2>0,1,0)
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    03-29-2012
    Location
    Santiago de Chile
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Replace cells and create dummy variables

    this might sound stupid, but how do i "run" something?

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

    Re: Replace cells and create dummy variables

    This might help...

    This is standard module code...

    http://www.rondebruin.nl/code.htm

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Replace cells and create dummy variables

    Paste it in VBA an run the macro.

    HOW TO INSTALL macro
    you are new to macro, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste the above code into the code window that just opened up. That's it.... you are doneste in VBA is alt + f11

    To start the macro you click on the button in the snelstartmenu of windows. (excel 2007) in my case the 8 icon.

    Or you use alt + F8 en select the macro and select run.
    Last edited by oeldere; 06-18-2012 at 02:39 PM. Reason: Or you use alt + f8

  7. #7
    Registered User
    Join Date
    03-29-2012
    Location
    Santiago de Chile
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Replace cells and create dummy variables

    Thank you very much. That helped a lot

  8. #8
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Replace cells and create dummy variables

    You help the forumhelpers if you add to whom you reply.

+ 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