+ Reply to Thread
Results 1 to 12 of 12

Extracting unique values from a column without zeros or n/a

  1. #1
    Registered User
    Join Date
    07-26-2011
    Location
    Lake Luzerne, New York
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    24

    Question Extracting unique values from a column without zeros or n/a

    So after some searching I found most of what I needed to extract the value(s) I need out of an array in my workbook. I found this link very helpful and comprehensive...



    http://www.get-digital-help.com/2009...om-one-column/


    In the document it describes the basic array formula I need, as well as 2 others to handle blanks and N/A's.

    Here are the 3:

    =INDEX(List,MATCH(0,COUNTIF($B$1:B1,List),0))
    This is the basic string, entered as an array formula

    =IF(ISNA(INDEX(List, MATCH(0, COUNTIF($B$1:B1, List), 0))), "", INDEX(List, MATCH(0, COUNTIF($B$1:B1, List), 0)))
    This eliminates the N/A's in Excel 2003 which I am using

    =INDEX(List,MATCH(0,IF(ISBLANK(List),"",COUNTIF($B$1:B1,List)),0)) + CTRL + SHIFT + ENTER
    This handles blank cells in my named range, which there will always be

    =INDEX(List,MATCH(0,(List="")+COUNTIF($B$1:B1,List)),0)) + CTRL + SHIFT + ENTER
    This is another version of the same basic formula another user submitted

    I am having trouble, however, nesting the 'blanks' formula and the 'n/a' formula together. All formulas work well on their own, but not together. Any suggestions?

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

    Re: Extracting unique values from a column without zeros or n/a

    Can you upload example workbook?

  3. #3
    Registered User
    Join Date
    07-26-2011
    Location
    Lake Luzerne, New York
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    24

    Re: Extracting unique values from a column without zeros or n/a

    I will try...the last time I tried to upload I failed lol

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

    Re: Extracting unique values from a column without zeros or n/a

    Must be less than 1MB

  5. #5
    Registered User
    Join Date
    07-26-2011
    Location
    Lake Luzerne, New York
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    24

    Re: Extracting unique values from a column without zeros or n/a

    ReworkInventory Withdrawal Stripped.xls

    The forumula I'm entering is on Totals!B17. It references the named range Rework_Records on the first sheet. In the formula, this ranges is as list, and B$1$:B1 should be $b16$:b16 in my formula.

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

    Re: Extracting unique values from a column without zeros or n/a

    So you just want to remove those #N/A?
    Didn't test functionality...
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    07-26-2011
    Location
    Lake Luzerne, New York
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    24

    Re: Extracting unique values from a column without zeros or n/a

    Thank you so much, it works fine. If you have 5 minutes in the next few days, could you roughly explain what you did? I've never used most of those funtions before.

  8. #8
    Registered User
    Join Date
    07-26-2011
    Location
    Lake Luzerne, New York
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    24

    Re: Extracting unique values from a column without zeros or n/a

    SOLVED!I just can't figure out where to note that so it gets recorded.

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

    Re: Extracting unique values from a column without zeros or n/a

    It's just a trick that you can implify in any formula that return text or error as result.
    A previous formula you had in cell I'll just continue to call your_formula.

    A LOOKUP formula will return you LAST value in an array ignoring errors.
    So, LOOKUP(REPT("Z",255), A1:A10) will return last value of a array that is not error.

    =LOOKUP("z",{"a","d","c","b"})
    will retun b because it can never find z so it look to the end of the range.

    To make sure that it will never find text string we will put very long ZZZZZZZZZZZZZZZZZZZZZZZ, actually Z repeated 255 times (REPT("Z",255)


    CHOOSE allows you to build an array of 2 values against which you can search according to the criteria value (in our case Z repeated 255 times)

    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"",your_formula))

    Basicaly, it will search last value of "" and your_formula. If your_formula return error it will return previous last value (that is "" aka blank)


    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"","snoproladd"))

    will return snoproladd

    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"",NA())

    will return Blank as #N/A is ignored given it is not text like the criteria.
    Last edited by zbor; 02-13-2012 at 11:32 AM.

  10. #10
    Registered User
    Join Date
    07-26-2011
    Location
    Lake Luzerne, New York
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    24

    Re: Extracting unique values from a column without zeros or n/a

    That actually makes sense. Thanks, I'll try to implement on my own in the future. As a question, you'll notice I have 800 lookup combo boxes on the first page. Can I change the 255 to 400 or so to be sure if I fill that entire page with records I'll never have issues?

    One of these days I'll go to Access with this and make it even better, but that's a whole nother story.

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

    Re: Extracting unique values from a column without zeros or n/a

    If you asking about REPT("Z",255) then answer is no. You don't need to change 255 because it doesn't have anything with data. It's a long string that excel compare with other. Z is because ZZZZ...ZZ is bigger than AAAA...AA so basicaly that's a value that can be never reach. You could use less (as I showed in example with single "z"). But why to risk? Use this as a ultimate reference and you'll never have problem.
    Last edited by zbor; 02-14-2012 at 04:52 AM.

  12. #12
    Registered User
    Join Date
    07-26-2011
    Location
    Lake Luzerne, New York
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    24

    Re: Extracting unique values from a column without zeros or n/a

    Oh, Ok. Its sinking in, but slowly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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