+ Reply to Thread
Results 1 to 10 of 10

Select Records and create a new column

  1. #1
    Registered User
    Join Date
    04-27-2009
    Location
    Lethbridge, Alberta
    MS-Off Ver
    Excel 2003
    Posts
    3

    Select Records and create a new column

    Hello,

    Attached is a clip of a spreadsheet which will help illustrate where I am stumped.

    Basically what I want to do is take any value that isnt "0" in column F and place it in another column in a nicely formatted table. So basically get rid of all the zeros...

    Im sure this has been done and asked before but I have no idea what to search for or if there is some easy forumla in excel for situations like this.

    Thanks for any tips,

    Adam

    P.S. I cant believe I never thought to find a forum for excel, this may become my new favorite site.
    Attached Files Attached Files
    Last edited by maxac8; 04-27-2009 at 11:36 AM. Reason: Problem Solved

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

    Re: Select Records and create a new column

    Something like this?

    =IF(F1=0;"";F1)

    (Change ; to , if needed)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select Records and create a new column

    Highlight column F
    Press F5
    Select Special
    Select Constants
    Select [ x ] Text only, uncheck the others
    Press OK

    CTRL-C to copy
    Click on new column and press ENTER

    ========

    For repetitive action, click on TOOLS > MACRO > Record a New Macro and record a macro of you doing all this, then you can do it all with the a click next time.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    04-27-2009
    Location
    Lethbridge, Alberta
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Select Records and create a new column

    Rereading my initial post I dont think I clearly stated my problem. Thank you bery much though JBeaucaire, that was what I initially asked.

    My table has 30,000 records in it. Of those records, I have identified approxiametly 2000 records which aren't zero. I want to take those 2000 records and put them into a seperate column with no spaces or zeros in between them.

    That way instead of having a table with 30,000 records, 2000 of which im interested in being dispersed randomly, i will have 1 nice neat column for which I can do further analysis on.

    Any Ideas?

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select Records and create a new column

    Click anwhere in the dataset and select DATA > AUTOFILTER. Small arrows will appear at the top of all the columns.

    Click on the arrow for column F and select 0 from the top of the list. All values OTHER than zero will be hidden.

    Copy and paste the visible data to another sheet or down below the original data, then go back and turn off the AUTOFILTER.

  6. #6
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: Select Records and create a new column

    This will put all the non zeros into a table on sheet 2, leaving the zeros in Sheet 1

    Please Login or Register  to view this content.
    Last edited by carsto; 04-27-2009 at 10:35 AM. Reason: MUCH EASIER SOLUTION JBEAUCAIRE!

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select Records and create a new column

    Quote Originally Posted by carsto
    Today at 07:35 AM. Reason: MUCH EASIER SOLUTION JBEAUCAIRE!
    Are you affirming my suggestion or chastising me? I can't figure out your intent.

    Also, like my first suggestion, yours solves the original query by the OP, which he has since corrected.

  8. #8
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: Select Records and create a new column

    to clarify

    JBEAUCAIRE"s IS A MUCH EASIER SOLUTION than mine!


  9. #9
    Registered User
    Join Date
    04-27-2009
    Location
    Lethbridge, Alberta
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Select Records and create a new column

    Thank you both for your help, I actually tried both solutions...

    The Autofilter worked great although I actually ended up using the "Sort Descending" command.

    The code seemed to be okay but it kept coming up with an error in the "x1" part of it.

    That may have been my fault however seeing as how I am not too familiar with VBA.

    Many thanks to everyone.

    Maxac8

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Select Records and create a new column

    Great! If that takes care of your need, be sure to EDIT your original post (Go Advanced) and mark the PREFIX box [SOLVED]

+ 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