+ Reply to Thread
Results 1 to 6 of 6

Find non-numbers in column

  1. #1
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Find non-numbers in column

    Hi

    Lets say I have the following going down column A:

    Please Login or Register  to view this content.
    Is there a combination of functions I could use to extract the non-numbers to a separate column? For example, my results would be

    Please Login or Register  to view this content.
    I know how to do via VBA, is there a way using worksheet functions?
    Last edited by davegugg; 08-02-2010 at 02:22 PM.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

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

    Re: Find non-numbers in column

    1) Put all values in column A. Let's assume the range is A1:A100 (this is important, cannot use entire column)

    2) In D1, enter this formula:
    =COUNTA(A:A)-COUNT(A:A)

    3) In E1, enter this array formula:
    =IF(ROW(A1)>$D$1, "", INDEX($A$1:$A$100, SMALL(IF(ISTEXT($A$1:$A$100), ROW($A$1:$A$100), ""), ROW(A1))))
    ...confirmed by pressing CTRL-SHIFT-ENTER..."Milwaukee" should appear in the first cell

    4) Copy E1 down as far as needed until values stop appearing.
    _________________
    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!)

  3. #3
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Find non-numbers in column

    Thanks JB, this gave my unexpected results and I'm not sure why. When I apply your formula to my real-life need, it becomes:

    {=IF(ROW('[RateSheetDocNumbers.xls]Doc Number Index'!A4)>$E$2,"",INDEX('[RateSheetDocNumbers.xls]Doc Number Index'!$A$4:$A$6017,SMALL(IF(ISTEXT('[RateSheetDocNumbers.xls]Doc Number Index'!$A$4:$A$6017),ROW('[RateSheetDocNumbers.xls]Doc Number Index'!$A$4:$A$6017),""),ROW('[RateSheetDocNumbers.xls]Doc Number Index'!A4))))}

    My data goes from A4 to A6017 in a separate workbook called RateSheetDocNumbers.xls, and the worksheet is called Doc Number Index.
    I put the counta - count formula on E2 of the worksheet I am looking to get the list to. When I entered the above, I got 3002 returned. When I copied down, I got 4002, 5002, 6002, blank. Cell E2 shows 7, which is the correct number of non-number values. I should also mention I have a custom cell number format in, of "0000".

    I also have a couple of questions.
    1) If I want to add to the "source" column later, can I make the formula go down to cell A10,000 in advance, or do I have to wait until there are values down to row 10,000?
    2) Could I substitute the formula that is in cell E2 into the above formula, or does it have to be in its own cell?

    Thanks a bunch!

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

    Re: Find non-numbers in column

    This worked for me:

    =IF(ROW(A1)>$E$1, "", INDEX([RateSheetDocNumbers.xls]Sheet1!$A$1:$A$10000, SMALL(IF(ISTEXT([RateSheetDocNumbers.xls]Sheet1!$A$1:$A$10000), ROW([RateSheetDocNumbers.xls]Sheet1!$A$1:$A$10000), ""), ROW(A1))))
    ...entered with CTRL-SHIFT-ENTER.


    Warning....a range of 10000 cells may have a noticeable performance hit. Just be aware that the array is causing the lag.

  5. #5
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Find non-numbers in column

    Strangely, I couldn't get it to work when I started in row 4, but when I switched it to row 1, it worked. This is solved as I can make that work, but if you have an explanation for that I'd be happy to hear it.

    Thanks JB

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

    Re: Find non-numbers in column

    My formula was designed for you to place it in any row for the first value, as long the formula still read ROW(A1) at the beginning and the end. The rest of the formula you could adjust, but not that starting value.

+ 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