Consulting

Results 1 to 3 of 3

Thread: Solved: Create an Array from a Filled Range

  1. #1
    VBAX Mentor asingh's Avatar
    Joined
    Jul 2005
    Posts
    307
    Location

    Solved: Create an Array from a Filled Range

    Hi,

    If I have a range from A1:A10, and I have another range B1:B10. Now B1:B10 cells either have a "1", or a "0", in them, corresponding, to A1:A10, based on a certain logic. How can I create another Array from B1:B10, which only contains the "1" values. [Or their row locations, so where ever a "1" is found, I pick up the ROW().

    Basically I am trying to create a dynamic...unique cell range. Using SUMPRODUCT, and a NESTED IF + COUNTIF I have been able to get the unique cells from A1:A10, but how to move them to another range..so they are exactly below each other...and no blanks are displayed.

    By the way...this has to be done..using on excel Native Function..NO VBA...

    I Used :

    =IF(SUMPRODUCT((COUNTIF(A2:$A$1062,A2)=1)*1)=0,"",A2)

    to unique cells...

    thanks a lot..for the help...

    regards,

    asingh

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Select a range of cells, say H1:H10, and enter this array formula in the formula bar

    =IF(ISERROR(SMALL(IF($B$1:$B$10=1,ROW($A1:$A10),""),ROW($A1:$A10))),"",
    INDEX(A$1:A$10,SMALL(IF($B$1:$B$10=1,ROW($A1:$A10),""),ROW($A1:$A10))))

    as it is an array formula, commit with Ctrl-Shift-Enter, not just Enter.

  3. #3
    VBAX Mentor asingh's Avatar
    Joined
    Jul 2005
    Posts
    307
    Location
    This is working perfect..I have a unique list from A column..based of my logic criteria..from B column..and NO VBA was used...........!

    XLD...You are great..and I just love this forum......!


    regards,

    asingh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •