+ Reply to Thread
Results 1 to 11 of 11

Remove values lower than 70 in column

  1. #1
    Registered User
    Join Date
    11-27-2014
    Location
    KBH
    MS-Off Ver
    2013
    Posts
    8

    Remove values lower than 70 in column

    Hey I need help.

    The data from an experiment was imported in the wrong way for some reason. The problem is this:
    98,7181
    98,7134
    9,8705
    98,6985
    98,6932
    98,6855
    9,8678
    98,6727
    98,6644
    9,8657
    98,6516
    98,6433
    98,6365

    As you can see, some of the data is 10 times lower than it should be. The 98 means 98 weight % from a sample.
    Is it possible to remove all data which is lower than 70 from a column?
    There are 5500 numbers and 6 files. Can’t do it by hand :P

    Frederik.

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Remove values lower than 70 in column

    You could simply sort then delete those lower records but if you want to correct the data why not put this formula in the adjoining column to restore the data correctly

    =if(A1<70, A1*10,A1)
    Happy with my advice? Click on the * reputation button below

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Remove values lower than 70 in column

    Put this macro in each file
    Selet range you want to use it (whole column or just some cells)
    And run macro.

    Change ' by desired result

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-27-2014
    Location
    KBH
    MS-Off Ver
    2013
    Posts
    8

    Re: Remove values lower than 70 in column

    The Macro worked ! Thank you

    Great help.

  5. #5
    Registered User
    Join Date
    11-27-2014
    Location
    KBH
    MS-Off Ver
    2013
    Posts
    8

    Re: Remove values lower than 70 in column

    Another question. If I want to remove all values equal to zero?

    Another macro :P

    Thanks

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Remove values lower than 70 in column

    Above should do that too (since 0 is less than 70).
    but here:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-27-2014
    Location
    KBH
    MS-Off Ver
    2013
    Posts
    8

    Re: Remove values lower than 70 in column

    It's for some other values. I also have negative values.

    But thank you for the macro

  8. #8
    Registered User
    Join Date
    11-27-2014
    Location
    KBH
    MS-Off Ver
    2013
    Posts
    8

    Re: Remove values lower than 70 in column

    Okay. My problem again is this.

    I am making a differentiation of the values. It is a weight vs temperatur plot.

    But a lot of the x-values (temperatur) are the same.

    And because i am doing (y2-y1)/(x2-x1) and a lot of times x2 = x1 I divide by zero. Soo how do I remove all the values where x2 = x1?

    I got the mistake 'type mismatch' for the macro.

    How do I remove 'divide by zero error'

    Looks like this:

    #DIVISION/0!
    #DIVISION/0!
    #DIVISION/0!
    #DIVISION/0!
    #DIVISION/0!
    -0,010741667
    -0,011022059
    -0,011022059
    -0,011022059
    -0,011022059
    -0,011022059
    #DIVISION/0!
    #DIVISION/0!
    #DIVISION/0!
    #DIVISION/0!
    #DIVISION/0!
    #DIVISION/0!
    #DIVISION/0!

    I only want the numbers

    Frederik.

  9. #9
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Remove values lower than 70 in column

    zbor

    Just for info and this might not affect the OP but when I ran your macro it didn't work for consecutive zeros in the column. I suspect the moving the cells up after the deletion means it skips a row so if there are two zeros or more it will delete the first, move the rows up one (ie the same row number as it just deleted) then move to the next row, hence skipping one row in the process.

    I modified your macro to this to resolve that problem


    Please Login or Register  to view this content.
    Last edited by Crooza; 11-27-2014 at 06:38 PM.

  10. #10
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Remove values lower than 70 in column

    frederick1234567

    Try this if your data is calculated data then this should work. Again highlight the cells you want to test and run the macro (it will remove ALL errors)

    Please Login or Register  to view this content.
    Last edited by Crooza; 11-27-2014 at 06:37 PM.

  11. #11
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Remove values lower than 70 in column

    Quote Originally Posted by Crooza View Post
    zbor

    Just for info and this might not affect the OP but when I ran your macro it didn't work for consecutive zeros in the column. I suspect the moving the cells up after the deletion means it skips a row so if there are two zeros or more it will delete the first, move the rows up one (ie the same row number as it just deleted) then move to the next row, hence skipping one row in the process.
    Thx for notify.
    Then it should go with for loop from last row to 1 with Step -1.

+ 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. change values to lower case & paste in a different column
    By RobinPrice in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2014, 06:30 PM
  2. Replies: 1
    Last Post: 02-26-2013, 07:49 PM
  3. Replies: 2
    Last Post: 02-26-2013, 05:41 PM
  4. Macro - Remove Duplicates and Lower Values
    By allblack in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2010, 07:58 AM
  5. Replies: 2
    Last Post: 05-31-2010, 03:23 PM

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