+ Reply to Thread
Results 1 to 85 of 85

Extract only items not on previous list

  1. #1
    Domenic
    Guest

    Re: Extract only items not on previous list

    Assuming that Column A contains your first list, and Column B contains
    your second list, try...

    C1:

    =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))

    D1, copied down:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

    Hope this helps!

    In article <byUJe.308$U92.51@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    > a, b, e, g
    >
    > and you want to extract only the items on the first list that are not on
    > the second list.
    >
    > I tried =IF(A1<>$B1:$B8,A1)
    >
    > and also
    >
    > {=IF(A1<>$B1:$B8,A1)}
    >
    > neither worked, any suggestions?
    >
    > Thanks,
    > Les


  2. #2
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 23:28:35 -0500, "Leslie Coover" <[email protected]> wrote:

    >Thanks Ron, this works good
    >
    >When there is an id field and an associated name field this method can
    >extract only the records in list 1(columns A and B) that do not appear in
    >list 2 (columns C and D) and then print the result in say columns G and H.
    >This is a big help.
    >Thanks,


    Glad to help. Thank you for the feedback.
    --ron

  3. #3
    Domenic
    Guest

    Re: Extract only items not on previous list

    Make sure that this part of the formula...

    INDEX('01.0A'!$A$1:$A$6

    ....is changed to...

    INDEX('01.0A'!A$1:A$6

    Therefore, your formulas should be as follows...

    A1:

    =SUMPRODUCT(--(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0))

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<=$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),R
    OWS(B$1:B1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

    In article <GGfKe.399$U92.87@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Thanks Domenic, I could not get the results I wanted, it simply displayed
    > the same id numbers
    > repeatedly, rather than including data in adjacent cells.
    >
    > If I had really huge data sets your method is definitely superior as results
    > can be printed on one worksheet
    > and the "long list" and "short list" can be kept in two other worksheets.
    > I'm sure there is a way to extract data in adjacent cells along with primary
    > key data, but the data sets I am concerned with are not that large so I
    > decided to use Ron's filter method (in this thread). To use that method all
    > the data must be kept on one sheet (there may be a way to use multiple
    > sheets here too--but I do not know it). The advantage is that the extracted
    > records can contain data in adjacent cells along with the primary data key.
    >
    > Les
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    > > Try...
    > >
    > > B1, copied down and across:
    > >
    > > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > > WS(B$1:B1))),"")
    > >
    > > Note that the column reference for...
    > >
    > > INDEX('01.0A'!A$1:A$6
    > >
    > > ...has been changed to a relative reference.
    > >
    > > Hope this helps!
    > >
    > > In article <rf4Ke.353$U92.195@okepread06>,
    > > "Leslie Coover" <[email protected]> wrote:
    > >
    > >> Okay so far so good
    > >> Now I have the "long" data in sheet 01.0A and the "short" data in
    > >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    > >>
    > >> and used
    > >>
    > >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    > >> 1:$
    > >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($
    > >> B$1
    > >> :B1))),"")
    > >>
    > >> This works allright, but it only lists the id # for each record, I want
    > >> all
    > >> the data for the whole record (column A to column D) what do I need to
    > >> change?
    > >>
    > >> Here is an example, if want
    > >>
    > >> W3245 peach 358 red
    > >> W2178 lemmon 548 yellow
    > >>
    > >> but I only get
    > >>
    > >> W3245
    > >> W2178
    > >>
    > >> I know I could concatanate all the data in each record so it fits into
    > >> just
    > >> one cell, but is there an easier way?
    > >>
    > >> Les


  4. #4
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Domenic, I could not get the results I wanted, it simply displayed
    the same id numbers
    repeatedly, rather than including data in adjacent cells.

    If I had really huge data sets your method is definitely superior as results
    can be printed on one worksheet
    and the "long list" and "short list" can be kept in two other worksheets.
    I'm sure there is a way to extract data in adjacent cells along with primary
    key data, but the data sets I am concerned with are not that large so I
    decided to use Ron's filter method (in this thread). To use that method all
    the data must be kept on one sheet (there may be a way to use multiple
    sheets here too--but I do not know it). The advantage is that the extracted
    records can contain data in adjacent cells along with the primary data key.

    Les
    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Try...
    >
    > B1, copied down and across:
    >
    > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > WS(B$1:B1))),"")
    >
    > Note that the column reference for...
    >
    > INDEX('01.0A'!A$1:A$6
    >
    > ...has been changed to a relative reference.
    >
    > Hope this helps!
    >
    > In article <rf4Ke.353$U92.195@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Okay so far so good
    >> Now I have the "long" data in sheet 01.0A and the "short" data in
    >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >>
    >> and used
    >>
    >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    >> :B1))),"")
    >>
    >> This works allright, but it only lists the id # for each record, I want
    >> all
    >> the data for the whole record (column A to column D) what do I need to
    >> change?
    >>
    >> Here is an example, if want
    >>
    >> W3245 peach 358 red
    >> W2178 lemmon 548 yellow
    >>
    >> but I only get
    >>
    >> W3245
    >> W2178
    >>
    >> I know I could concatanate all the data in each record so it fits into
    >> just
    >> one cell, but is there an easier way?
    >>
    >> Les




  5. #5
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Ron, this works good

    When there is an id field and an associated name field this method can
    extract only the records in list 1(columns A and B) that do not appear in
    list 2 (columns C and D) and then print the result in say columns G and H.
    This is a big help.
    Thanks,

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Not sure what you mean?
    >>
    >>A1:A6 = {a, b, c, d, e, f}
    >>B1:B3 = {a, d, f}
    >>
    >>how should I reorganize the data to use the formula
    >>=COUNTIF($A$9:$A$11,B9)=0
    >>as a criteria in an advance filter and what should I enter in
    >>List Range box?
    >>
    >>Thanks.

    >
    > OK , you've reversed your lists. And you do have to have things laid out
    > in a
    > defined way to get the advanced filter to work. Here's one way.
    >
    > I assume that the result you want is {b,c,e}.
    >
    > Set up a worksheet as follows
    >
    > A B
    > List1 List2
    > a a
    > b d
    > c f
    > d
    > e
    > f
    >
    > (In columns A & B; and Rows 1-7; note that a header row is used)
    >
    > E1: <empty>
    > E2: =COUNTIF($B$2:$B$4,A2)=0
    >
    > Data/Filter/Advanced Filter
    > Action: Copy to another location
    > List Range: $A$1:$B$7
    > Criteria Range: $E$1:$E$2
    > Copy to: G1
    > <OK>
    >
    > In columns G & H you will see:
    >
    > List1 List2
    > b d
    > c f
    > e
    >
    > You are only interested in List1 so you can either delete H1:H3 or copy
    > column
    > G to wherever. Or set things up to display the results some other way.
    >
    > The above could also be done using a macro. Probably you should use the
    > macro
    > recorder if you choose this option.
    >
    >
    >
    > --ron




  6. #6
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]> wrote:

    >Not sure what you mean?
    >
    >A1:A6 = {a, b, c, d, e, f}
    >B1:B3 = {a, d, f}
    >
    >how should I reorganize the data to use the formula
    >=COUNTIF($A$9:$A$11,B9)=0
    >as a criteria in an advance filter and what should I enter in
    >List Range box?
    >
    >Thanks.


    OK , you've reversed your lists. And you do have to have things laid out in a
    defined way to get the advanced filter to work. Here's one way.

    I assume that the result you want is {b,c,e}.

    Set up a worksheet as follows

    A B
    List1 List2
    a a
    b d
    c f
    d
    e
    f

    (In columns A & B; and Rows 1-7; note that a header row is used)

    E1: <empty>
    E2: =COUNTIF($B$2:$B$4,A2)=0

    Data/Filter/Advanced Filter
    Action: Copy to another location
    List Range: $A$1:$B$7
    Criteria Range: $E$1:$E$2
    Copy to: G1
    <OK>

    In columns G & H you will see:

    List1 List2
    b d
    c f
    e

    You are only interested in List1 so you can either delete H1:H3 or copy column
    G to wherever. Or set things up to display the results some other way.

    The above could also be done using a macro. Probably you should use the macro
    recorder if you choose this option.



    --ron

  7. #7
    Domenic
    Guest

    Re: Extract only items not on previous list

    Try...

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    WS(B$1:B1))),"")

    Note that the column reference for...

    INDEX('01.0A'!A$1:A$6

    ....has been changed to a relative reference.

    Hope this helps!

    In article <rf4Ke.353$U92.195@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Okay so far so good
    > Now I have the "long" data in sheet 01.0A and the "short" data in
    > sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >
    > and used
    >
    > =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    > A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    > :B1))),"")
    >
    > This works allright, but it only lists the id # for each record, I want all
    > the data for the whole record (column A to column D) what do I need to
    > change?
    >
    > Here is an example, if want
    >
    > W3245 peach 358 red
    > W2178 lemmon 548 yellow
    >
    > but I only get
    >
    > W3245
    > W2178
    >
    > I know I could concatanate all the data in each record so it fits into just
    > one cell, but is there an easier way?
    >
    > Les


  8. #8
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Not sure what you mean?

    A1:A6 = {a, b, c, d, e, f}
    B1:B3 = {a, d, f}

    how should I reorganize the data to use the formula
    =COUNTIF($A$9:$A$11,B9)=0
    as a criteria in an advance filter and what should I enter in
    List Range box?

    Thanks.

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >>a, b, e, g
    >>
    >>and you want to extract only the items on the first list that are not on
    >>the second list.
    >>
    >>I tried =IF(A1<>$B1:$B8,A1)
    >>
    >>and also
    >>
    >>{=IF(A1<>$B1:$B8,A1)}
    >>
    >>neither worked, any suggestions?
    >>
    >>Thanks,
    >>Les
    >>

    >
    > You could also use the Advanced Filter (On the Data menu).
    >
    > If your data was moved down to A9, then the formula would be:
    >
    > =COUNTIF($A$9:$A$11,B9)=0
    >
    >
    > --ron




  9. #9
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Okay so far so good
    Now I have the "long" data in sheet 01.0A and the "short" data in
    sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C

    and used

    =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1:B1))),"")

    This works allright, but it only lists the id # for each record, I want all
    the data for the whole record (column A to column D) what do I need to
    change?

    Here is an example, if want

    W3245 peach 358 red
    W2178 lemmon 548 yellow

    but I only get

    W3245
    W2178

    I know I could concatanate all the data in each record so it fits into just
    one cell, but is there an easier way?

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  10. #10
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]> wrote:

    >Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    >a, b, e, g
    >
    >and you want to extract only the items on the first list that are not on
    >the second list.
    >
    >I tried =IF(A1<>$B1:$B8,A1)
    >
    >and also
    >
    >{=IF(A1<>$B1:$B8,A1)}
    >
    >neither worked, any suggestions?
    >
    >Thanks,
    >Les
    >


    You could also use the Advanced Filter (On the Data menu).

    If your data was moved down to A9, then the formula would be:

    =COUNTIF($A$9:$A$11,B9)=0


    --ron

  11. #11
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Works fine, thanks!

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  12. #12
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3

    Here is the data
    A1:A3 {a, d, f}
    B1:B6 {a, b, c, d, e, f}

    I want the items in B1:B6 that don't appear in A1:A3

    Tried to use a Vlookup and If function and it worked but was cumbersome.

    How about this VBA code solution?

    Create an outside loop that steps through each item in the long list.
    Create an inside loop that steps through each item on the short list

    If there is no match the active cell is printed in an adjacent cell. If
    there is a match
    the inside loop terminates and the outside loop increments to the next item
    on the list.

    And so it goes until the last item on the long list is checked.

    Could someone give me some help with this code?

    Les

    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Assuming that Column A contains your first list, and Column B contains
    > your second list, try...
    >
    > C1:
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >
    > D1, copied down:
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    > A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >
    > Hope this helps!
    >
    > In article <byUJe.308$U92.51@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >> a, b, e, g
    >>
    >> and you want to extract only the items on the first list that are not on
    >> the second list.
    >>
    >> I tried =IF(A1<>$B1:$B8,A1)
    >>
    >> and also
    >>
    >> {=IF(A1<>$B1:$B8,A1)}
    >>
    >> neither worked, any suggestions?
    >>
    >> Thanks,
    >> Les




  13. #13
    Biff
    Guest

    Re: Extract only items not on previous list

    Hi!

    The formula works but the example you posted originally is the opposite of
    the example you just posted. So, just reverse some of the references:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($B$1:$B$6,SMALL(IF(COUNTIF($A$1:$A$3,$B$1:$B$6)=0,ROW($B$1:$B$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    Array entered.

    Biff

    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >




  14. #14
    Peo Sjoblom
    Guest

    Re: Extract only items not on previous list

    It works fine for me as expected
    you can change Dominic's formula to fit that as well but it would be easier
    if you put

    a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    C1 to

    =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))

    and the formula in D1 to

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    array enter and copy down returns b, c and e

    if you want to keep your layout change Dominic's formula accordingly

    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >



  15. #15
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Okay so far so good
    Now I have the "long" data in sheet 01.0A and the "short" data in
    sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C

    and used

    =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1:B1))),"")

    This works allright, but it only lists the id # for each record, I want all
    the data for the whole record (column A to column D) what do I need to
    change?

    Here is an example, if want

    W3245 peach 358 red
    W2178 lemmon 548 yellow

    but I only get

    W3245
    W2178

    I know I could concatanate all the data in each record so it fits into just
    one cell, but is there an easier way?

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  16. #16
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Not sure what you mean?

    A1:A6 = {a, b, c, d, e, f}
    B1:B3 = {a, d, f}

    how should I reorganize the data to use the formula
    =COUNTIF($A$9:$A$11,B9)=0
    as a criteria in an advance filter and what should I enter in
    List Range box?

    Thanks.

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >>a, b, e, g
    >>
    >>and you want to extract only the items on the first list that are not on
    >>the second list.
    >>
    >>I tried =IF(A1<>$B1:$B8,A1)
    >>
    >>and also
    >>
    >>{=IF(A1<>$B1:$B8,A1)}
    >>
    >>neither worked, any suggestions?
    >>
    >>Thanks,
    >>Les
    >>

    >
    > You could also use the Advanced Filter (On the Data menu).
    >
    > If your data was moved down to A9, then the formula would be:
    >
    > =COUNTIF($A$9:$A$11,B9)=0
    >
    >
    > --ron




  17. #17
    Domenic
    Guest

    Re: Extract only items not on previous list

    Try...

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    WS(B$1:B1))),"")

    Note that the column reference for...

    INDEX('01.0A'!A$1:A$6

    ....has been changed to a relative reference.

    Hope this helps!

    In article <rf4Ke.353$U92.195@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Okay so far so good
    > Now I have the "long" data in sheet 01.0A and the "short" data in
    > sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >
    > and used
    >
    > =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    > A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    > :B1))),"")
    >
    > This works allright, but it only lists the id # for each record, I want all
    > the data for the whole record (column A to column D) what do I need to
    > change?
    >
    > Here is an example, if want
    >
    > W3245 peach 358 red
    > W2178 lemmon 548 yellow
    >
    > but I only get
    >
    > W3245
    > W2178
    >
    > I know I could concatanate all the data in each record so it fits into just
    > one cell, but is there an easier way?
    >
    > Les


  18. #18
    Domenic
    Guest

    Re: Extract only items not on previous list

    Assuming that Column A contains your first list, and Column B contains
    your second list, try...

    C1:

    =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))

    D1, copied down:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

    Hope this helps!

    In article <byUJe.308$U92.51@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    > a, b, e, g
    >
    > and you want to extract only the items on the first list that are not on
    > the second list.
    >
    > I tried =IF(A1<>$B1:$B8,A1)
    >
    > and also
    >
    > {=IF(A1<>$B1:$B8,A1)}
    >
    > neither worked, any suggestions?
    >
    > Thanks,
    > Les


  19. #19
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]> wrote:

    >Not sure what you mean?
    >
    >A1:A6 = {a, b, c, d, e, f}
    >B1:B3 = {a, d, f}
    >
    >how should I reorganize the data to use the formula
    >=COUNTIF($A$9:$A$11,B9)=0
    >as a criteria in an advance filter and what should I enter in
    >List Range box?
    >
    >Thanks.


    OK , you've reversed your lists. And you do have to have things laid out in a
    defined way to get the advanced filter to work. Here's one way.

    I assume that the result you want is {b,c,e}.

    Set up a worksheet as follows

    A B
    List1 List2
    a a
    b d
    c f
    d
    e
    f

    (In columns A & B; and Rows 1-7; note that a header row is used)

    E1: <empty>
    E2: =COUNTIF($B$2:$B$4,A2)=0

    Data/Filter/Advanced Filter
    Action: Copy to another location
    List Range: $A$1:$B$7
    Criteria Range: $E$1:$E$2
    Copy to: G1
    <OK>

    In columns G & H you will see:

    List1 List2
    b d
    c f
    e

    You are only interested in List1 so you can either delete H1:H3 or copy column
    G to wherever. Or set things up to display the results some other way.

    The above could also be done using a macro. Probably you should use the macro
    recorder if you choose this option.



    --ron

  20. #20
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3

    Here is the data
    A1:A3 {a, d, f}
    B1:B6 {a, b, c, d, e, f}

    I want the items in B1:B6 that don't appear in A1:A3

    Tried to use a Vlookup and If function and it worked but was cumbersome.

    How about this VBA code solution?

    Create an outside loop that steps through each item in the long list.
    Create an inside loop that steps through each item on the short list

    If there is no match the active cell is printed in an adjacent cell. If
    there is a match
    the inside loop terminates and the outside loop increments to the next item
    on the list.

    And so it goes until the last item on the long list is checked.

    Could someone give me some help with this code?

    Les

    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Assuming that Column A contains your first list, and Column B contains
    > your second list, try...
    >
    > C1:
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >
    > D1, copied down:
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    > A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >
    > Hope this helps!
    >
    > In article <byUJe.308$U92.51@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >> a, b, e, g
    >>
    >> and you want to extract only the items on the first list that are not on
    >> the second list.
    >>
    >> I tried =IF(A1<>$B1:$B8,A1)
    >>
    >> and also
    >>
    >> {=IF(A1<>$B1:$B8,A1)}
    >>
    >> neither worked, any suggestions?
    >>
    >> Thanks,
    >> Les




  21. #21
    Biff
    Guest

    Re: Extract only items not on previous list

    Hi!

    The formula works but the example you posted originally is the opposite of
    the example you just posted. So, just reverse some of the references:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($B$1:$B$6,SMALL(IF(COUNTIF($A$1:$A$3,$B$1:$B$6)=0,ROW($B$1:$B$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    Array entered.

    Biff

    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >




  22. #22
    Peo Sjoblom
    Guest

    Re: Extract only items not on previous list

    It works fine for me as expected
    you can change Dominic's formula to fit that as well but it would be easier
    if you put

    a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    C1 to

    =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))

    and the formula in D1 to

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    array enter and copy down returns b, c and e

    if you want to keep your layout change Dominic's formula accordingly

    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >



  23. #23
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Ron, this works good

    When there is an id field and an associated name field this method can
    extract only the records in list 1(columns A and B) that do not appear in
    list 2 (columns C and D) and then print the result in say columns G and H.
    This is a big help.
    Thanks,

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Not sure what you mean?
    >>
    >>A1:A6 = {a, b, c, d, e, f}
    >>B1:B3 = {a, d, f}
    >>
    >>how should I reorganize the data to use the formula
    >>=COUNTIF($A$9:$A$11,B9)=0
    >>as a criteria in an advance filter and what should I enter in
    >>List Range box?
    >>
    >>Thanks.

    >
    > OK , you've reversed your lists. And you do have to have things laid out
    > in a
    > defined way to get the advanced filter to work. Here's one way.
    >
    > I assume that the result you want is {b,c,e}.
    >
    > Set up a worksheet as follows
    >
    > A B
    > List1 List2
    > a a
    > b d
    > c f
    > d
    > e
    > f
    >
    > (In columns A & B; and Rows 1-7; note that a header row is used)
    >
    > E1: <empty>
    > E2: =COUNTIF($B$2:$B$4,A2)=0
    >
    > Data/Filter/Advanced Filter
    > Action: Copy to another location
    > List Range: $A$1:$B$7
    > Criteria Range: $E$1:$E$2
    > Copy to: G1
    > <OK>
    >
    > In columns G & H you will see:
    >
    > List1 List2
    > b d
    > c f
    > e
    >
    > You are only interested in List1 so you can either delete H1:H3 or copy
    > column
    > G to wherever. Or set things up to display the results some other way.
    >
    > The above could also be done using a macro. Probably you should use the
    > macro
    > recorder if you choose this option.
    >
    >
    >
    > --ron




  24. #24
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Works fine, thanks!

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  25. #25
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Domenic, I could not get the results I wanted, it simply displayed
    the same id numbers
    repeatedly, rather than including data in adjacent cells.

    If I had really huge data sets your method is definitely superior as results
    can be printed on one worksheet
    and the "long list" and "short list" can be kept in two other worksheets.
    I'm sure there is a way to extract data in adjacent cells along with primary
    key data, but the data sets I am concerned with are not that large so I
    decided to use Ron's filter method (in this thread). To use that method all
    the data must be kept on one sheet (there may be a way to use multiple
    sheets here too--but I do not know it). The advantage is that the extracted
    records can contain data in adjacent cells along with the primary data key.

    Les
    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Try...
    >
    > B1, copied down and across:
    >
    > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > WS(B$1:B1))),"")
    >
    > Note that the column reference for...
    >
    > INDEX('01.0A'!A$1:A$6
    >
    > ...has been changed to a relative reference.
    >
    > Hope this helps!
    >
    > In article <rf4Ke.353$U92.195@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Okay so far so good
    >> Now I have the "long" data in sheet 01.0A and the "short" data in
    >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >>
    >> and used
    >>
    >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    >> :B1))),"")
    >>
    >> This works allright, but it only lists the id # for each record, I want
    >> all
    >> the data for the whole record (column A to column D) what do I need to
    >> change?
    >>
    >> Here is an example, if want
    >>
    >> W3245 peach 358 red
    >> W2178 lemmon 548 yellow
    >>
    >> but I only get
    >>
    >> W3245
    >> W2178
    >>
    >> I know I could concatanate all the data in each record so it fits into
    >> just
    >> one cell, but is there an easier way?
    >>
    >> Les




  26. #26
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]> wrote:

    >Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    >a, b, e, g
    >
    >and you want to extract only the items on the first list that are not on
    >the second list.
    >
    >I tried =IF(A1<>$B1:$B8,A1)
    >
    >and also
    >
    >{=IF(A1<>$B1:$B8,A1)}
    >
    >neither worked, any suggestions?
    >
    >Thanks,
    >Les
    >


    You could also use the Advanced Filter (On the Data menu).

    If your data was moved down to A9, then the formula would be:

    =COUNTIF($A$9:$A$11,B9)=0


    --ron

  27. #27
    Domenic
    Guest

    Re: Extract only items not on previous list

    Make sure that this part of the formula...

    INDEX('01.0A'!$A$1:$A$6

    ....is changed to...

    INDEX('01.0A'!A$1:A$6

    Therefore, your formulas should be as follows...

    A1:

    =SUMPRODUCT(--(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0))

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<=$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),R
    OWS(B$1:B1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

    In article <GGfKe.399$U92.87@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Thanks Domenic, I could not get the results I wanted, it simply displayed
    > the same id numbers
    > repeatedly, rather than including data in adjacent cells.
    >
    > If I had really huge data sets your method is definitely superior as results
    > can be printed on one worksheet
    > and the "long list" and "short list" can be kept in two other worksheets.
    > I'm sure there is a way to extract data in adjacent cells along with primary
    > key data, but the data sets I am concerned with are not that large so I
    > decided to use Ron's filter method (in this thread). To use that method all
    > the data must be kept on one sheet (there may be a way to use multiple
    > sheets here too--but I do not know it). The advantage is that the extracted
    > records can contain data in adjacent cells along with the primary data key.
    >
    > Les
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    > > Try...
    > >
    > > B1, copied down and across:
    > >
    > > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > > WS(B$1:B1))),"")
    > >
    > > Note that the column reference for...
    > >
    > > INDEX('01.0A'!A$1:A$6
    > >
    > > ...has been changed to a relative reference.
    > >
    > > Hope this helps!
    > >
    > > In article <rf4Ke.353$U92.195@okepread06>,
    > > "Leslie Coover" <[email protected]> wrote:
    > >
    > >> Okay so far so good
    > >> Now I have the "long" data in sheet 01.0A and the "short" data in
    > >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    > >>
    > >> and used
    > >>
    > >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    > >> 1:$
    > >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($
    > >> B$1
    > >> :B1))),"")
    > >>
    > >> This works allright, but it only lists the id # for each record, I want
    > >> all
    > >> the data for the whole record (column A to column D) what do I need to
    > >> change?
    > >>
    > >> Here is an example, if want
    > >>
    > >> W3245 peach 358 red
    > >> W2178 lemmon 548 yellow
    > >>
    > >> but I only get
    > >>
    > >> W3245
    > >> W2178
    > >>
    > >> I know I could concatanate all the data in each record so it fits into
    > >> just
    > >> one cell, but is there an easier way?
    > >>
    > >> Les


  28. #28
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 23:28:35 -0500, "Leslie Coover" <[email protected]> wrote:

    >Thanks Ron, this works good
    >
    >When there is an id field and an associated name field this method can
    >extract only the records in list 1(columns A and B) that do not appear in
    >list 2 (columns C and D) and then print the result in say columns G and H.
    >This is a big help.
    >Thanks,


    Glad to help. Thank you for the feedback.
    --ron

  29. #29
    Domenic
    Guest

    Re: Extract only items not on previous list

    Assuming that Column A contains your first list, and Column B contains
    your second list, try...

    C1:

    =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))

    D1, copied down:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

    Hope this helps!

    In article <byUJe.308$U92.51@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    > a, b, e, g
    >
    > and you want to extract only the items on the first list that are not on
    > the second list.
    >
    > I tried =IF(A1<>$B1:$B8,A1)
    >
    > and also
    >
    > {=IF(A1<>$B1:$B8,A1)}
    >
    > neither worked, any suggestions?
    >
    > Thanks,
    > Les


  30. #30
    Peo Sjoblom
    Guest

    Re: Extract only items not on previous list

    It works fine for me as expected
    you can change Dominic's formula to fit that as well but it would be easier
    if you put

    a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    C1 to

    =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))

    and the formula in D1 to

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    array enter and copy down returns b, c and e

    if you want to keep your layout change Dominic's formula accordingly

    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >



  31. #31
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 23:28:35 -0500, "Leslie Coover" <[email protected]> wrote:

    >Thanks Ron, this works good
    >
    >When there is an id field and an associated name field this method can
    >extract only the records in list 1(columns A and B) that do not appear in
    >list 2 (columns C and D) and then print the result in say columns G and H.
    >This is a big help.
    >Thanks,


    Glad to help. Thank you for the feedback.
    --ron

  32. #32
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3

    Here is the data
    A1:A3 {a, d, f}
    B1:B6 {a, b, c, d, e, f}

    I want the items in B1:B6 that don't appear in A1:A3

    Tried to use a Vlookup and If function and it worked but was cumbersome.

    How about this VBA code solution?

    Create an outside loop that steps through each item in the long list.
    Create an inside loop that steps through each item on the short list

    If there is no match the active cell is printed in an adjacent cell. If
    there is a match
    the inside loop terminates and the outside loop increments to the next item
    on the list.

    And so it goes until the last item on the long list is checked.

    Could someone give me some help with this code?

    Les

    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Assuming that Column A contains your first list, and Column B contains
    > your second list, try...
    >
    > C1:
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >
    > D1, copied down:
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    > A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >
    > Hope this helps!
    >
    > In article <byUJe.308$U92.51@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >> a, b, e, g
    >>
    >> and you want to extract only the items on the first list that are not on
    >> the second list.
    >>
    >> I tried =IF(A1<>$B1:$B8,A1)
    >>
    >> and also
    >>
    >> {=IF(A1<>$B1:$B8,A1)}
    >>
    >> neither worked, any suggestions?
    >>
    >> Thanks,
    >> Les




  33. #33
    Biff
    Guest

    Re: Extract only items not on previous list

    Hi!

    The formula works but the example you posted originally is the opposite of
    the example you just posted. So, just reverse some of the references:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($B$1:$B$6,SMALL(IF(COUNTIF($A$1:$A$3,$B$1:$B$6)=0,ROW($B$1:$B$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    Array entered.

    Biff

    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >




  34. #34
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Domenic, I could not get the results I wanted, it simply displayed
    the same id numbers
    repeatedly, rather than including data in adjacent cells.

    If I had really huge data sets your method is definitely superior as results
    can be printed on one worksheet
    and the "long list" and "short list" can be kept in two other worksheets.
    I'm sure there is a way to extract data in adjacent cells along with primary
    key data, but the data sets I am concerned with are not that large so I
    decided to use Ron's filter method (in this thread). To use that method all
    the data must be kept on one sheet (there may be a way to use multiple
    sheets here too--but I do not know it). The advantage is that the extracted
    records can contain data in adjacent cells along with the primary data key.

    Les
    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Try...
    >
    > B1, copied down and across:
    >
    > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > WS(B$1:B1))),"")
    >
    > Note that the column reference for...
    >
    > INDEX('01.0A'!A$1:A$6
    >
    > ...has been changed to a relative reference.
    >
    > Hope this helps!
    >
    > In article <rf4Ke.353$U92.195@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Okay so far so good
    >> Now I have the "long" data in sheet 01.0A and the "short" data in
    >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >>
    >> and used
    >>
    >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    >> :B1))),"")
    >>
    >> This works allright, but it only lists the id # for each record, I want
    >> all
    >> the data for the whole record (column A to column D) what do I need to
    >> change?
    >>
    >> Here is an example, if want
    >>
    >> W3245 peach 358 red
    >> W2178 lemmon 548 yellow
    >>
    >> but I only get
    >>
    >> W3245
    >> W2178
    >>
    >> I know I could concatanate all the data in each record so it fits into
    >> just
    >> one cell, but is there an easier way?
    >>
    >> Les




  35. #35
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Works fine, thanks!

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  36. #36
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]> wrote:

    >Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    >a, b, e, g
    >
    >and you want to extract only the items on the first list that are not on
    >the second list.
    >
    >I tried =IF(A1<>$B1:$B8,A1)
    >
    >and also
    >
    >{=IF(A1<>$B1:$B8,A1)}
    >
    >neither worked, any suggestions?
    >
    >Thanks,
    >Les
    >


    You could also use the Advanced Filter (On the Data menu).

    If your data was moved down to A9, then the formula would be:

    =COUNTIF($A$9:$A$11,B9)=0


    --ron

  37. #37
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Okay so far so good
    Now I have the "long" data in sheet 01.0A and the "short" data in
    sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C

    and used

    =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1:B1))),"")

    This works allright, but it only lists the id # for each record, I want all
    the data for the whole record (column A to column D) what do I need to
    change?

    Here is an example, if want

    W3245 peach 358 red
    W2178 lemmon 548 yellow

    but I only get

    W3245
    W2178

    I know I could concatanate all the data in each record so it fits into just
    one cell, but is there an easier way?

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  38. #38
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Not sure what you mean?

    A1:A6 = {a, b, c, d, e, f}
    B1:B3 = {a, d, f}

    how should I reorganize the data to use the formula
    =COUNTIF($A$9:$A$11,B9)=0
    as a criteria in an advance filter and what should I enter in
    List Range box?

    Thanks.

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >>a, b, e, g
    >>
    >>and you want to extract only the items on the first list that are not on
    >>the second list.
    >>
    >>I tried =IF(A1<>$B1:$B8,A1)
    >>
    >>and also
    >>
    >>{=IF(A1<>$B1:$B8,A1)}
    >>
    >>neither worked, any suggestions?
    >>
    >>Thanks,
    >>Les
    >>

    >
    > You could also use the Advanced Filter (On the Data menu).
    >
    > If your data was moved down to A9, then the formula would be:
    >
    > =COUNTIF($A$9:$A$11,B9)=0
    >
    >
    > --ron




  39. #39
    Domenic
    Guest

    Re: Extract only items not on previous list

    Try...

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    WS(B$1:B1))),"")

    Note that the column reference for...

    INDEX('01.0A'!A$1:A$6

    ....has been changed to a relative reference.

    Hope this helps!

    In article <rf4Ke.353$U92.195@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Okay so far so good
    > Now I have the "long" data in sheet 01.0A and the "short" data in
    > sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >
    > and used
    >
    > =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    > A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    > :B1))),"")
    >
    > This works allright, but it only lists the id # for each record, I want all
    > the data for the whole record (column A to column D) what do I need to
    > change?
    >
    > Here is an example, if want
    >
    > W3245 peach 358 red
    > W2178 lemmon 548 yellow
    >
    > but I only get
    >
    > W3245
    > W2178
    >
    > I know I could concatanate all the data in each record so it fits into just
    > one cell, but is there an easier way?
    >
    > Les


  40. #40
    Domenic
    Guest

    Re: Extract only items not on previous list

    Make sure that this part of the formula...

    INDEX('01.0A'!$A$1:$A$6

    ....is changed to...

    INDEX('01.0A'!A$1:A$6

    Therefore, your formulas should be as follows...

    A1:

    =SUMPRODUCT(--(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0))

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<=$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),R
    OWS(B$1:B1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

    In article <GGfKe.399$U92.87@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Thanks Domenic, I could not get the results I wanted, it simply displayed
    > the same id numbers
    > repeatedly, rather than including data in adjacent cells.
    >
    > If I had really huge data sets your method is definitely superior as results
    > can be printed on one worksheet
    > and the "long list" and "short list" can be kept in two other worksheets.
    > I'm sure there is a way to extract data in adjacent cells along with primary
    > key data, but the data sets I am concerned with are not that large so I
    > decided to use Ron's filter method (in this thread). To use that method all
    > the data must be kept on one sheet (there may be a way to use multiple
    > sheets here too--but I do not know it). The advantage is that the extracted
    > records can contain data in adjacent cells along with the primary data key.
    >
    > Les
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    > > Try...
    > >
    > > B1, copied down and across:
    > >
    > > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > > WS(B$1:B1))),"")
    > >
    > > Note that the column reference for...
    > >
    > > INDEX('01.0A'!A$1:A$6
    > >
    > > ...has been changed to a relative reference.
    > >
    > > Hope this helps!
    > >
    > > In article <rf4Ke.353$U92.195@okepread06>,
    > > "Leslie Coover" <[email protected]> wrote:
    > >
    > >> Okay so far so good
    > >> Now I have the "long" data in sheet 01.0A and the "short" data in
    > >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    > >>
    > >> and used
    > >>
    > >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    > >> 1:$
    > >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($
    > >> B$1
    > >> :B1))),"")
    > >>
    > >> This works allright, but it only lists the id # for each record, I want
    > >> all
    > >> the data for the whole record (column A to column D) what do I need to
    > >> change?
    > >>
    > >> Here is an example, if want
    > >>
    > >> W3245 peach 358 red
    > >> W2178 lemmon 548 yellow
    > >>
    > >> but I only get
    > >>
    > >> W3245
    > >> W2178
    > >>
    > >> I know I could concatanate all the data in each record so it fits into
    > >> just
    > >> one cell, but is there an easier way?
    > >>
    > >> Les


  41. #41
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]> wrote:

    >Not sure what you mean?
    >
    >A1:A6 = {a, b, c, d, e, f}
    >B1:B3 = {a, d, f}
    >
    >how should I reorganize the data to use the formula
    >=COUNTIF($A$9:$A$11,B9)=0
    >as a criteria in an advance filter and what should I enter in
    >List Range box?
    >
    >Thanks.


    OK , you've reversed your lists. And you do have to have things laid out in a
    defined way to get the advanced filter to work. Here's one way.

    I assume that the result you want is {b,c,e}.

    Set up a worksheet as follows

    A B
    List1 List2
    a a
    b d
    c f
    d
    e
    f

    (In columns A & B; and Rows 1-7; note that a header row is used)

    E1: <empty>
    E2: =COUNTIF($B$2:$B$4,A2)=0

    Data/Filter/Advanced Filter
    Action: Copy to another location
    List Range: $A$1:$B$7
    Criteria Range: $E$1:$E$2
    Copy to: G1
    <OK>

    In columns G & H you will see:

    List1 List2
    b d
    c f
    e

    You are only interested in List1 so you can either delete H1:H3 or copy column
    G to wherever. Or set things up to display the results some other way.

    The above could also be done using a macro. Probably you should use the macro
    recorder if you choose this option.



    --ron

  42. #42
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Ron, this works good

    When there is an id field and an associated name field this method can
    extract only the records in list 1(columns A and B) that do not appear in
    list 2 (columns C and D) and then print the result in say columns G and H.
    This is a big help.
    Thanks,

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Not sure what you mean?
    >>
    >>A1:A6 = {a, b, c, d, e, f}
    >>B1:B3 = {a, d, f}
    >>
    >>how should I reorganize the data to use the formula
    >>=COUNTIF($A$9:$A$11,B9)=0
    >>as a criteria in an advance filter and what should I enter in
    >>List Range box?
    >>
    >>Thanks.

    >
    > OK , you've reversed your lists. And you do have to have things laid out
    > in a
    > defined way to get the advanced filter to work. Here's one way.
    >
    > I assume that the result you want is {b,c,e}.
    >
    > Set up a worksheet as follows
    >
    > A B
    > List1 List2
    > a a
    > b d
    > c f
    > d
    > e
    > f
    >
    > (In columns A & B; and Rows 1-7; note that a header row is used)
    >
    > E1: <empty>
    > E2: =COUNTIF($B$2:$B$4,A2)=0
    >
    > Data/Filter/Advanced Filter
    > Action: Copy to another location
    > List Range: $A$1:$B$7
    > Criteria Range: $E$1:$E$2
    > Copy to: G1
    > <OK>
    >
    > In columns G & H you will see:
    >
    > List1 List2
    > b d
    > c f
    > e
    >
    > You are only interested in List1 so you can either delete H1:H3 or copy
    > column
    > G to wherever. Or set things up to display the results some other way.
    >
    > The above could also be done using a macro. Probably you should use the
    > macro
    > recorder if you choose this option.
    >
    >
    >
    > --ron




  43. #43
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Okay so far so good
    Now I have the "long" data in sheet 01.0A and the "short" data in
    sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C

    and used

    =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1:B1))),"")

    This works allright, but it only lists the id # for each record, I want all
    the data for the whole record (column A to column D) what do I need to
    change?

    Here is an example, if want

    W3245 peach 358 red
    W2178 lemmon 548 yellow

    but I only get

    W3245
    W2178

    I know I could concatanate all the data in each record so it fits into just
    one cell, but is there an easier way?

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  44. #44
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Domenic, I could not get the results I wanted, it simply displayed
    the same id numbers
    repeatedly, rather than including data in adjacent cells.

    If I had really huge data sets your method is definitely superior as results
    can be printed on one worksheet
    and the "long list" and "short list" can be kept in two other worksheets.
    I'm sure there is a way to extract data in adjacent cells along with primary
    key data, but the data sets I am concerned with are not that large so I
    decided to use Ron's filter method (in this thread). To use that method all
    the data must be kept on one sheet (there may be a way to use multiple
    sheets here too--but I do not know it). The advantage is that the extracted
    records can contain data in adjacent cells along with the primary data key.

    Les
    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Try...
    >
    > B1, copied down and across:
    >
    > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > WS(B$1:B1))),"")
    >
    > Note that the column reference for...
    >
    > INDEX('01.0A'!A$1:A$6
    >
    > ...has been changed to a relative reference.
    >
    > Hope this helps!
    >
    > In article <rf4Ke.353$U92.195@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Okay so far so good
    >> Now I have the "long" data in sheet 01.0A and the "short" data in
    >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >>
    >> and used
    >>
    >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    >> :B1))),"")
    >>
    >> This works allright, but it only lists the id # for each record, I want
    >> all
    >> the data for the whole record (column A to column D) what do I need to
    >> change?
    >>
    >> Here is an example, if want
    >>
    >> W3245 peach 358 red
    >> W2178 lemmon 548 yellow
    >>
    >> but I only get
    >>
    >> W3245
    >> W2178
    >>
    >> I know I could concatanate all the data in each record so it fits into
    >> just
    >> one cell, but is there an easier way?
    >>
    >> Les




  45. #45
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Ron, this works good

    When there is an id field and an associated name field this method can
    extract only the records in list 1(columns A and B) that do not appear in
    list 2 (columns C and D) and then print the result in say columns G and H.
    This is a big help.
    Thanks,

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Not sure what you mean?
    >>
    >>A1:A6 = {a, b, c, d, e, f}
    >>B1:B3 = {a, d, f}
    >>
    >>how should I reorganize the data to use the formula
    >>=COUNTIF($A$9:$A$11,B9)=0
    >>as a criteria in an advance filter and what should I enter in
    >>List Range box?
    >>
    >>Thanks.

    >
    > OK , you've reversed your lists. And you do have to have things laid out
    > in a
    > defined way to get the advanced filter to work. Here's one way.
    >
    > I assume that the result you want is {b,c,e}.
    >
    > Set up a worksheet as follows
    >
    > A B
    > List1 List2
    > a a
    > b d
    > c f
    > d
    > e
    > f
    >
    > (In columns A & B; and Rows 1-7; note that a header row is used)
    >
    > E1: <empty>
    > E2: =COUNTIF($B$2:$B$4,A2)=0
    >
    > Data/Filter/Advanced Filter
    > Action: Copy to another location
    > List Range: $A$1:$B$7
    > Criteria Range: $E$1:$E$2
    > Copy to: G1
    > <OK>
    >
    > In columns G & H you will see:
    >
    > List1 List2
    > b d
    > c f
    > e
    >
    > You are only interested in List1 so you can either delete H1:H3 or copy
    > column
    > G to wherever. Or set things up to display the results some other way.
    >
    > The above could also be done using a macro. Probably you should use the
    > macro
    > recorder if you choose this option.
    >
    >
    >
    > --ron




  46. #46
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]> wrote:

    >Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    >a, b, e, g
    >
    >and you want to extract only the items on the first list that are not on
    >the second list.
    >
    >I tried =IF(A1<>$B1:$B8,A1)
    >
    >and also
    >
    >{=IF(A1<>$B1:$B8,A1)}
    >
    >neither worked, any suggestions?
    >
    >Thanks,
    >Les
    >


    You could also use the Advanced Filter (On the Data menu).

    If your data was moved down to A9, then the formula would be:

    =COUNTIF($A$9:$A$11,B9)=0


    --ron

  47. #47
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Works fine, thanks!

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  48. #48
    Domenic
    Guest

    Re: Extract only items not on previous list

    Make sure that this part of the formula...

    INDEX('01.0A'!$A$1:$A$6

    ....is changed to...

    INDEX('01.0A'!A$1:A$6

    Therefore, your formulas should be as follows...

    A1:

    =SUMPRODUCT(--(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0))

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<=$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),R
    OWS(B$1:B1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

    In article <GGfKe.399$U92.87@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Thanks Domenic, I could not get the results I wanted, it simply displayed
    > the same id numbers
    > repeatedly, rather than including data in adjacent cells.
    >
    > If I had really huge data sets your method is definitely superior as results
    > can be printed on one worksheet
    > and the "long list" and "short list" can be kept in two other worksheets.
    > I'm sure there is a way to extract data in adjacent cells along with primary
    > key data, but the data sets I am concerned with are not that large so I
    > decided to use Ron's filter method (in this thread). To use that method all
    > the data must be kept on one sheet (there may be a way to use multiple
    > sheets here too--but I do not know it). The advantage is that the extracted
    > records can contain data in adjacent cells along with the primary data key.
    >
    > Les
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    > > Try...
    > >
    > > B1, copied down and across:
    > >
    > > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > > WS(B$1:B1))),"")
    > >
    > > Note that the column reference for...
    > >
    > > INDEX('01.0A'!A$1:A$6
    > >
    > > ...has been changed to a relative reference.
    > >
    > > Hope this helps!
    > >
    > > In article <rf4Ke.353$U92.195@okepread06>,
    > > "Leslie Coover" <[email protected]> wrote:
    > >
    > >> Okay so far so good
    > >> Now I have the "long" data in sheet 01.0A and the "short" data in
    > >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    > >>
    > >> and used
    > >>
    > >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    > >> 1:$
    > >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($
    > >> B$1
    > >> :B1))),"")
    > >>
    > >> This works allright, but it only lists the id # for each record, I want
    > >> all
    > >> the data for the whole record (column A to column D) what do I need to
    > >> change?
    > >>
    > >> Here is an example, if want
    > >>
    > >> W3245 peach 358 red
    > >> W2178 lemmon 548 yellow
    > >>
    > >> but I only get
    > >>
    > >> W3245
    > >> W2178
    > >>
    > >> I know I could concatanate all the data in each record so it fits into
    > >> just
    > >> one cell, but is there an easier way?
    > >>
    > >> Les


  49. #49
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]> wrote:

    >Not sure what you mean?
    >
    >A1:A6 = {a, b, c, d, e, f}
    >B1:B3 = {a, d, f}
    >
    >how should I reorganize the data to use the formula
    >=COUNTIF($A$9:$A$11,B9)=0
    >as a criteria in an advance filter and what should I enter in
    >List Range box?
    >
    >Thanks.


    OK , you've reversed your lists. And you do have to have things laid out in a
    defined way to get the advanced filter to work. Here's one way.

    I assume that the result you want is {b,c,e}.

    Set up a worksheet as follows

    A B
    List1 List2
    a a
    b d
    c f
    d
    e
    f

    (In columns A & B; and Rows 1-7; note that a header row is used)

    E1: <empty>
    E2: =COUNTIF($B$2:$B$4,A2)=0

    Data/Filter/Advanced Filter
    Action: Copy to another location
    List Range: $A$1:$B$7
    Criteria Range: $E$1:$E$2
    Copy to: G1
    <OK>

    In columns G & H you will see:

    List1 List2
    b d
    c f
    e

    You are only interested in List1 so you can either delete H1:H3 or copy column
    G to wherever. Or set things up to display the results some other way.

    The above could also be done using a macro. Probably you should use the macro
    recorder if you choose this option.



    --ron

  50. #50
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 23:28:35 -0500, "Leslie Coover" <[email protected]> wrote:

    >Thanks Ron, this works good
    >
    >When there is an id field and an associated name field this method can
    >extract only the records in list 1(columns A and B) that do not appear in
    >list 2 (columns C and D) and then print the result in say columns G and H.
    >This is a big help.
    >Thanks,


    Glad to help. Thank you for the feedback.
    --ron

  51. #51
    Domenic
    Guest

    Re: Extract only items not on previous list

    Try...

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    WS(B$1:B1))),"")

    Note that the column reference for...

    INDEX('01.0A'!A$1:A$6

    ....has been changed to a relative reference.

    Hope this helps!

    In article <rf4Ke.353$U92.195@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Okay so far so good
    > Now I have the "long" data in sheet 01.0A and the "short" data in
    > sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >
    > and used
    >
    > =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    > A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    > :B1))),"")
    >
    > This works allright, but it only lists the id # for each record, I want all
    > the data for the whole record (column A to column D) what do I need to
    > change?
    >
    > Here is an example, if want
    >
    > W3245 peach 358 red
    > W2178 lemmon 548 yellow
    >
    > but I only get
    >
    > W3245
    > W2178
    >
    > I know I could concatanate all the data in each record so it fits into just
    > one cell, but is there an easier way?
    >
    > Les


  52. #52
    Peo Sjoblom
    Guest

    Re: Extract only items not on previous list

    It works fine for me as expected
    you can change Dominic's formula to fit that as well but it would be easier
    if you put

    a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    C1 to

    =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))

    and the formula in D1 to

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    array enter and copy down returns b, c and e

    if you want to keep your layout change Dominic's formula accordingly

    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >



  53. #53
    Biff
    Guest

    Re: Extract only items not on previous list

    Hi!

    The formula works but the example you posted originally is the opposite of
    the example you just posted. So, just reverse some of the references:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($B$1:$B$6,SMALL(IF(COUNTIF($A$1:$A$3,$B$1:$B$6)=0,ROW($B$1:$B$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    Array entered.

    Biff

    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >




  54. #54
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3

    Here is the data
    A1:A3 {a, d, f}
    B1:B6 {a, b, c, d, e, f}

    I want the items in B1:B6 that don't appear in A1:A3

    Tried to use a Vlookup and If function and it worked but was cumbersome.

    How about this VBA code solution?

    Create an outside loop that steps through each item in the long list.
    Create an inside loop that steps through each item on the short list

    If there is no match the active cell is printed in an adjacent cell. If
    there is a match
    the inside loop terminates and the outside loop increments to the next item
    on the list.

    And so it goes until the last item on the long list is checked.

    Could someone give me some help with this code?

    Les

    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Assuming that Column A contains your first list, and Column B contains
    > your second list, try...
    >
    > C1:
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >
    > D1, copied down:
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    > A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >
    > Hope this helps!
    >
    > In article <byUJe.308$U92.51@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >> a, b, e, g
    >>
    >> and you want to extract only the items on the first list that are not on
    >> the second list.
    >>
    >> I tried =IF(A1<>$B1:$B8,A1)
    >>
    >> and also
    >>
    >> {=IF(A1<>$B1:$B8,A1)}
    >>
    >> neither worked, any suggestions?
    >>
    >> Thanks,
    >> Les




  55. #55
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Not sure what you mean?

    A1:A6 = {a, b, c, d, e, f}
    B1:B3 = {a, d, f}

    how should I reorganize the data to use the formula
    =COUNTIF($A$9:$A$11,B9)=0
    as a criteria in an advance filter and what should I enter in
    List Range box?

    Thanks.

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >>a, b, e, g
    >>
    >>and you want to extract only the items on the first list that are not on
    >>the second list.
    >>
    >>I tried =IF(A1<>$B1:$B8,A1)
    >>
    >>and also
    >>
    >>{=IF(A1<>$B1:$B8,A1)}
    >>
    >>neither worked, any suggestions?
    >>
    >>Thanks,
    >>Les
    >>

    >
    > You could also use the Advanced Filter (On the Data menu).
    >
    > If your data was moved down to A9, then the formula would be:
    >
    > =COUNTIF($A$9:$A$11,B9)=0
    >
    >
    > --ron




  56. #56
    Domenic
    Guest

    Re: Extract only items not on previous list

    Assuming that Column A contains your first list, and Column B contains
    your second list, try...

    C1:

    =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))

    D1, copied down:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

    Hope this helps!

    In article <byUJe.308$U92.51@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    > a, b, e, g
    >
    > and you want to extract only the items on the first list that are not on
    > the second list.
    >
    > I tried =IF(A1<>$B1:$B8,A1)
    >
    > and also
    >
    > {=IF(A1<>$B1:$B8,A1)}
    >
    > neither worked, any suggestions?
    >
    > Thanks,
    > Les


  57. #57
    Biff
    Guest

    Re: Extract only items not on previous list

    Hi!

    The formula works but the example you posted originally is the opposite of
    the example you just posted. So, just reverse some of the references:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($B$1:$B$6,SMALL(IF(COUNTIF($A$1:$A$3,$B$1:$B$6)=0,ROW($B$1:$B$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    Array entered.

    Biff

    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >




  58. #58
    Peo Sjoblom
    Guest

    Re: Extract only items not on previous list

    It works fine for me as expected
    you can change Dominic's formula to fit that as well but it would be easier
    if you put

    a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    C1 to

    =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))

    and the formula in D1 to

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    array enter and copy down returns b, c and e

    if you want to keep your layout change Dominic's formula accordingly

    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >



  59. #59
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 23:28:35 -0500, "Leslie Coover" <[email protected]> wrote:

    >Thanks Ron, this works good
    >
    >When there is an id field and an associated name field this method can
    >extract only the records in list 1(columns A and B) that do not appear in
    >list 2 (columns C and D) and then print the result in say columns G and H.
    >This is a big help.
    >Thanks,


    Glad to help. Thank you for the feedback.
    --ron

  60. #60
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3

    Here is the data
    A1:A3 {a, d, f}
    B1:B6 {a, b, c, d, e, f}

    I want the items in B1:B6 that don't appear in A1:A3

    Tried to use a Vlookup and If function and it worked but was cumbersome.

    How about this VBA code solution?

    Create an outside loop that steps through each item in the long list.
    Create an inside loop that steps through each item on the short list

    If there is no match the active cell is printed in an adjacent cell. If
    there is a match
    the inside loop terminates and the outside loop increments to the next item
    on the list.

    And so it goes until the last item on the long list is checked.

    Could someone give me some help with this code?

    Les

    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Assuming that Column A contains your first list, and Column B contains
    > your second list, try...
    >
    > C1:
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >
    > D1, copied down:
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    > A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >
    > Hope this helps!
    >
    > In article <byUJe.308$U92.51@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >> a, b, e, g
    >>
    >> and you want to extract only the items on the first list that are not on
    >> the second list.
    >>
    >> I tried =IF(A1<>$B1:$B8,A1)
    >>
    >> and also
    >>
    >> {=IF(A1<>$B1:$B8,A1)}
    >>
    >> neither worked, any suggestions?
    >>
    >> Thanks,
    >> Les




  61. #61
    Domenic
    Guest

    Re: Extract only items not on previous list

    Make sure that this part of the formula...

    INDEX('01.0A'!$A$1:$A$6

    ....is changed to...

    INDEX('01.0A'!A$1:A$6

    Therefore, your formulas should be as follows...

    A1:

    =SUMPRODUCT(--(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0))

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<=$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),R
    OWS(B$1:B1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

    In article <GGfKe.399$U92.87@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Thanks Domenic, I could not get the results I wanted, it simply displayed
    > the same id numbers
    > repeatedly, rather than including data in adjacent cells.
    >
    > If I had really huge data sets your method is definitely superior as results
    > can be printed on one worksheet
    > and the "long list" and "short list" can be kept in two other worksheets.
    > I'm sure there is a way to extract data in adjacent cells along with primary
    > key data, but the data sets I am concerned with are not that large so I
    > decided to use Ron's filter method (in this thread). To use that method all
    > the data must be kept on one sheet (there may be a way to use multiple
    > sheets here too--but I do not know it). The advantage is that the extracted
    > records can contain data in adjacent cells along with the primary data key.
    >
    > Les
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    > > Try...
    > >
    > > B1, copied down and across:
    > >
    > > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > > WS(B$1:B1))),"")
    > >
    > > Note that the column reference for...
    > >
    > > INDEX('01.0A'!A$1:A$6
    > >
    > > ...has been changed to a relative reference.
    > >
    > > Hope this helps!
    > >
    > > In article <rf4Ke.353$U92.195@okepread06>,
    > > "Leslie Coover" <[email protected]> wrote:
    > >
    > >> Okay so far so good
    > >> Now I have the "long" data in sheet 01.0A and the "short" data in
    > >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    > >>
    > >> and used
    > >>
    > >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    > >> 1:$
    > >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($
    > >> B$1
    > >> :B1))),"")
    > >>
    > >> This works allright, but it only lists the id # for each record, I want
    > >> all
    > >> the data for the whole record (column A to column D) what do I need to
    > >> change?
    > >>
    > >> Here is an example, if want
    > >>
    > >> W3245 peach 358 red
    > >> W2178 lemmon 548 yellow
    > >>
    > >> but I only get
    > >>
    > >> W3245
    > >> W2178
    > >>
    > >> I know I could concatanate all the data in each record so it fits into
    > >> just
    > >> one cell, but is there an easier way?
    > >>
    > >> Les


  62. #62
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Works fine, thanks!

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  63. #63
    Domenic
    Guest

    Re: Extract only items not on previous list

    Assuming that Column A contains your first list, and Column B contains
    your second list, try...

    C1:

    =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))

    D1, copied down:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

    Hope this helps!

    In article <byUJe.308$U92.51@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    > a, b, e, g
    >
    > and you want to extract only the items on the first list that are not on
    > the second list.
    >
    > I tried =IF(A1<>$B1:$B8,A1)
    >
    > and also
    >
    > {=IF(A1<>$B1:$B8,A1)}
    >
    > neither worked, any suggestions?
    >
    > Thanks,
    > Les


  64. #64
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Domenic, I could not get the results I wanted, it simply displayed
    the same id numbers
    repeatedly, rather than including data in adjacent cells.

    If I had really huge data sets your method is definitely superior as results
    can be printed on one worksheet
    and the "long list" and "short list" can be kept in two other worksheets.
    I'm sure there is a way to extract data in adjacent cells along with primary
    key data, but the data sets I am concerned with are not that large so I
    decided to use Ron's filter method (in this thread). To use that method all
    the data must be kept on one sheet (there may be a way to use multiple
    sheets here too--but I do not know it). The advantage is that the extracted
    records can contain data in adjacent cells along with the primary data key.

    Les
    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Try...
    >
    > B1, copied down and across:
    >
    > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > WS(B$1:B1))),"")
    >
    > Note that the column reference for...
    >
    > INDEX('01.0A'!A$1:A$6
    >
    > ...has been changed to a relative reference.
    >
    > Hope this helps!
    >
    > In article <rf4Ke.353$U92.195@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Okay so far so good
    >> Now I have the "long" data in sheet 01.0A and the "short" data in
    >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >>
    >> and used
    >>
    >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    >> :B1))),"")
    >>
    >> This works allright, but it only lists the id # for each record, I want
    >> all
    >> the data for the whole record (column A to column D) what do I need to
    >> change?
    >>
    >> Here is an example, if want
    >>
    >> W3245 peach 358 red
    >> W2178 lemmon 548 yellow
    >>
    >> but I only get
    >>
    >> W3245
    >> W2178
    >>
    >> I know I could concatanate all the data in each record so it fits into
    >> just
    >> one cell, but is there an easier way?
    >>
    >> Les




  65. #65
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Ron, this works good

    When there is an id field and an associated name field this method can
    extract only the records in list 1(columns A and B) that do not appear in
    list 2 (columns C and D) and then print the result in say columns G and H.
    This is a big help.
    Thanks,

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Not sure what you mean?
    >>
    >>A1:A6 = {a, b, c, d, e, f}
    >>B1:B3 = {a, d, f}
    >>
    >>how should I reorganize the data to use the formula
    >>=COUNTIF($A$9:$A$11,B9)=0
    >>as a criteria in an advance filter and what should I enter in
    >>List Range box?
    >>
    >>Thanks.

    >
    > OK , you've reversed your lists. And you do have to have things laid out
    > in a
    > defined way to get the advanced filter to work. Here's one way.
    >
    > I assume that the result you want is {b,c,e}.
    >
    > Set up a worksheet as follows
    >
    > A B
    > List1 List2
    > a a
    > b d
    > c f
    > d
    > e
    > f
    >
    > (In columns A & B; and Rows 1-7; note that a header row is used)
    >
    > E1: <empty>
    > E2: =COUNTIF($B$2:$B$4,A2)=0
    >
    > Data/Filter/Advanced Filter
    > Action: Copy to another location
    > List Range: $A$1:$B$7
    > Criteria Range: $E$1:$E$2
    > Copy to: G1
    > <OK>
    >
    > In columns G & H you will see:
    >
    > List1 List2
    > b d
    > c f
    > e
    >
    > You are only interested in List1 so you can either delete H1:H3 or copy
    > column
    > G to wherever. Or set things up to display the results some other way.
    >
    > The above could also be done using a macro. Probably you should use the
    > macro
    > recorder if you choose this option.
    >
    >
    >
    > --ron




  66. #66
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]> wrote:

    >Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    >a, b, e, g
    >
    >and you want to extract only the items on the first list that are not on
    >the second list.
    >
    >I tried =IF(A1<>$B1:$B8,A1)
    >
    >and also
    >
    >{=IF(A1<>$B1:$B8,A1)}
    >
    >neither worked, any suggestions?
    >
    >Thanks,
    >Les
    >


    You could also use the Advanced Filter (On the Data menu).

    If your data was moved down to A9, then the formula would be:

    =COUNTIF($A$9:$A$11,B9)=0


    --ron

  67. #67
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]> wrote:

    >Not sure what you mean?
    >
    >A1:A6 = {a, b, c, d, e, f}
    >B1:B3 = {a, d, f}
    >
    >how should I reorganize the data to use the formula
    >=COUNTIF($A$9:$A$11,B9)=0
    >as a criteria in an advance filter and what should I enter in
    >List Range box?
    >
    >Thanks.


    OK , you've reversed your lists. And you do have to have things laid out in a
    defined way to get the advanced filter to work. Here's one way.

    I assume that the result you want is {b,c,e}.

    Set up a worksheet as follows

    A B
    List1 List2
    a a
    b d
    c f
    d
    e
    f

    (In columns A & B; and Rows 1-7; note that a header row is used)

    E1: <empty>
    E2: =COUNTIF($B$2:$B$4,A2)=0

    Data/Filter/Advanced Filter
    Action: Copy to another location
    List Range: $A$1:$B$7
    Criteria Range: $E$1:$E$2
    Copy to: G1
    <OK>

    In columns G & H you will see:

    List1 List2
    b d
    c f
    e

    You are only interested in List1 so you can either delete H1:H3 or copy column
    G to wherever. Or set things up to display the results some other way.

    The above could also be done using a macro. Probably you should use the macro
    recorder if you choose this option.



    --ron

  68. #68
    Domenic
    Guest

    Re: Extract only items not on previous list

    Try...

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    WS(B$1:B1))),"")

    Note that the column reference for...

    INDEX('01.0A'!A$1:A$6

    ....has been changed to a relative reference.

    Hope this helps!

    In article <rf4Ke.353$U92.195@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Okay so far so good
    > Now I have the "long" data in sheet 01.0A and the "short" data in
    > sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >
    > and used
    >
    > =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    > A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    > :B1))),"")
    >
    > This works allright, but it only lists the id # for each record, I want all
    > the data for the whole record (column A to column D) what do I need to
    > change?
    >
    > Here is an example, if want
    >
    > W3245 peach 358 red
    > W2178 lemmon 548 yellow
    >
    > but I only get
    >
    > W3245
    > W2178
    >
    > I know I could concatanate all the data in each record so it fits into just
    > one cell, but is there an easier way?
    >
    > Les


  69. #69
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Not sure what you mean?

    A1:A6 = {a, b, c, d, e, f}
    B1:B3 = {a, d, f}

    how should I reorganize the data to use the formula
    =COUNTIF($A$9:$A$11,B9)=0
    as a criteria in an advance filter and what should I enter in
    List Range box?

    Thanks.

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >>a, b, e, g
    >>
    >>and you want to extract only the items on the first list that are not on
    >>the second list.
    >>
    >>I tried =IF(A1<>$B1:$B8,A1)
    >>
    >>and also
    >>
    >>{=IF(A1<>$B1:$B8,A1)}
    >>
    >>neither worked, any suggestions?
    >>
    >>Thanks,
    >>Les
    >>

    >
    > You could also use the Advanced Filter (On the Data menu).
    >
    > If your data was moved down to A9, then the formula would be:
    >
    > =COUNTIF($A$9:$A$11,B9)=0
    >
    >
    > --ron




  70. #70
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Okay so far so good
    Now I have the "long" data in sheet 01.0A and the "short" data in
    sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C

    and used

    =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1:B1))),"")

    This works allright, but it only lists the id # for each record, I want all
    the data for the whole record (column A to column D) what do I need to
    change?

    Here is an example, if want

    W3245 peach 358 red
    W2178 lemmon 548 yellow

    but I only get

    W3245
    W2178

    I know I could concatanate all the data in each record so it fits into just
    one cell, but is there an easier way?

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  71. #71
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]> wrote:

    >Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    >a, b, e, g
    >
    >and you want to extract only the items on the first list that are not on
    >the second list.
    >
    >I tried =IF(A1<>$B1:$B8,A1)
    >
    >and also
    >
    >{=IF(A1<>$B1:$B8,A1)}
    >
    >neither worked, any suggestions?
    >
    >Thanks,
    >Les
    >


    You could also use the Advanced Filter (On the Data menu).

    If your data was moved down to A9, then the formula would be:

    =COUNTIF($A$9:$A$11,B9)=0


    --ron

  72. #72
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Domenic, I could not get the results I wanted, it simply displayed
    the same id numbers
    repeatedly, rather than including data in adjacent cells.

    If I had really huge data sets your method is definitely superior as results
    can be printed on one worksheet
    and the "long list" and "short list" can be kept in two other worksheets.
    I'm sure there is a way to extract data in adjacent cells along with primary
    key data, but the data sets I am concerned with are not that large so I
    decided to use Ron's filter method (in this thread). To use that method all
    the data must be kept on one sheet (there may be a way to use multiple
    sheets here too--but I do not know it). The advantage is that the extracted
    records can contain data in adjacent cells along with the primary data key.

    Les
    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Try...
    >
    > B1, copied down and across:
    >
    > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > WS(B$1:B1))),"")
    >
    > Note that the column reference for...
    >
    > INDEX('01.0A'!A$1:A$6
    >
    > ...has been changed to a relative reference.
    >
    > Hope this helps!
    >
    > In article <rf4Ke.353$U92.195@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Okay so far so good
    >> Now I have the "long" data in sheet 01.0A and the "short" data in
    >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >>
    >> and used
    >>
    >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    >> :B1))),"")
    >>
    >> This works allright, but it only lists the id # for each record, I want
    >> all
    >> the data for the whole record (column A to column D) what do I need to
    >> change?
    >>
    >> Here is an example, if want
    >>
    >> W3245 peach 358 red
    >> W2178 lemmon 548 yellow
    >>
    >> but I only get
    >>
    >> W3245
    >> W2178
    >>
    >> I know I could concatanate all the data in each record so it fits into
    >> just
    >> one cell, but is there an easier way?
    >>
    >> Les




  73. #73
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Works fine, thanks!

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  74. #74
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Okay so far so good
    Now I have the "long" data in sheet 01.0A and the "short" data in
    sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C

    and used

    =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1:B1))),"")

    This works allright, but it only lists the id # for each record, I want all
    the data for the whole record (column A to column D) what do I need to
    change?

    Here is an example, if want

    W3245 peach 358 red
    W2178 lemmon 548 yellow

    but I only get

    W3245
    W2178

    I know I could concatanate all the data in each record so it fits into just
    one cell, but is there an easier way?

    Les

    "Peo Sjoblom" <[email protected]> wrote in message
    news:%[email protected]...
    > It works fine for me as expected
    > you can change Dominic's formula to fit that as well but it would be
    > easier if you put
    >
    > a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    > C1 to
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))
    >
    > and the formula in D1 to
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > array enter and copy down returns b, c and e
    >
    > if you want to keep your layout change Dominic's formula accordingly
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "Leslie Coover" <[email protected]> wrote in message
    > news:_xWJe.327$U92.24@okepread06...
    >> When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >>
    >> Here is the data
    >> A1:A3 {a, d, f}
    >> B1:B6 {a, b, c, d, e, f}
    >>
    >> I want the items in B1:B6 that don't appear in A1:A3
    >>
    >> Tried to use a Vlookup and If function and it worked but was cumbersome.
    >>
    >> How about this VBA code solution?
    >>
    >> Create an outside loop that steps through each item in the long list.
    >> Create an inside loop that steps through each item on the short list
    >>
    >> If there is no match the active cell is printed in an adjacent cell. If
    >> there is a match
    >> the inside loop terminates and the outside loop increments to the next
    >> item on the list.
    >>
    >> And so it goes until the last item on the long list is checked.
    >>
    >> Could someone give me some help with this code?
    >>
    >> Les
    >>
    >> "Domenic" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Assuming that Column A contains your first list, and Column B contains
    >>> your second list, try...
    >>>
    >>> C1:
    >>>
    >>> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>>
    >>> D1, copied down:
    >>>
    >>> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >>> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>>
    >>> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>>
    >>> Hope this helps!
    >>>
    >>> In article <byUJe.308$U92.51@okepread06>,
    >>> "Leslie Coover" <[email protected]> wrote:
    >>>
    >>>> Suppose you have two lists:
    >>>>
    >>>> a, b, c, d, e, f, g
    >>>>
    >>>> and
    >>>> a, b, e, g
    >>>>
    >>>> and you want to extract only the items on the first list that are not
    >>>> on
    >>>> the second list.
    >>>>
    >>>> I tried =IF(A1<>$B1:$B8,A1)
    >>>>
    >>>> and also
    >>>>
    >>>> {=IF(A1<>$B1:$B8,A1)}
    >>>>
    >>>> neither worked, any suggestions?
    >>>>
    >>>> Thanks,
    >>>> Les

    >>
    >>

    >




  75. #75
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Not sure what you mean?

    A1:A6 = {a, b, c, d, e, f}
    B1:B3 = {a, d, f}

    how should I reorganize the data to use the formula
    =COUNTIF($A$9:$A$11,B9)=0
    as a criteria in an advance filter and what should I enter in
    List Range box?

    Thanks.

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Mon, 8 Aug 2005 21:29:26 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >>a, b, e, g
    >>
    >>and you want to extract only the items on the first list that are not on
    >>the second list.
    >>
    >>I tried =IF(A1<>$B1:$B8,A1)
    >>
    >>and also
    >>
    >>{=IF(A1<>$B1:$B8,A1)}
    >>
    >>neither worked, any suggestions?
    >>
    >>Thanks,
    >>Les
    >>

    >
    > You could also use the Advanced Filter (On the Data menu).
    >
    > If your data was moved down to A9, then the formula would be:
    >
    > =COUNTIF($A$9:$A$11,B9)=0
    >
    >
    > --ron




  76. #76
    Peo Sjoblom
    Guest

    Re: Extract only items not on previous list

    It works fine for me as expected
    you can change Dominic's formula to fit that as well but it would be easier
    if you put

    a,b,c,d,e,f, in A1:A5 and a,d,f, in B1:B3 then change Dominic's formula in
    C1 to

    =SUMPRODUCT(--(COUNTIF($B$1:$B$3,$A$1:$A$6)=0))

    and the formula in D1 to

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$6,SMALL(IF(COUNTIF($B$1:$B$3,$A$1:$A$6)=0,ROW($A$1:$A$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    array enter and copy down returns b, c and e

    if you want to keep your layout change Dominic's formula accordingly

    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >



  77. #77
    Domenic
    Guest

    Re: Extract only items not on previous list

    Try...

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    WS(B$1:B1))),"")

    Note that the column reference for...

    INDEX('01.0A'!A$1:A$6

    ....has been changed to a relative reference.

    Hope this helps!

    In article <rf4Ke.353$U92.195@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Okay so far so good
    > Now I have the "long" data in sheet 01.0A and the "short" data in
    > sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    >
    > and used
    >
    > =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$1:$
    > A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($B$1
    > :B1))),"")
    >
    > This works allright, but it only lists the id # for each record, I want all
    > the data for the whole record (column A to column D) what do I need to
    > change?
    >
    > Here is an example, if want
    >
    > W3245 peach 358 red
    > W2178 lemmon 548 yellow
    >
    > but I only get
    >
    > W3245
    > W2178
    >
    > I know I could concatanate all the data in each record so it fits into just
    > one cell, but is there an easier way?
    >
    > Les


  78. #78
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3

    Here is the data
    A1:A3 {a, d, f}
    B1:B6 {a, b, c, d, e, f}

    I want the items in B1:B6 that don't appear in A1:A3

    Tried to use a Vlookup and If function and it worked but was cumbersome.

    How about this VBA code solution?

    Create an outside loop that steps through each item in the long list.
    Create an inside loop that steps through each item on the short list

    If there is no match the active cell is printed in an adjacent cell. If
    there is a match
    the inside loop terminates and the outside loop increments to the next item
    on the list.

    And so it goes until the last item on the long list is checked.

    Could someone give me some help with this code?

    Les

    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Assuming that Column A contains your first list, and Column B contains
    > your second list, try...
    >
    > C1:
    >
    > =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >
    > D1, copied down:
    >
    > =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    > A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >
    > ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >
    > Hope this helps!
    >
    > In article <byUJe.308$U92.51@okepread06>,
    > "Leslie Coover" <[email protected]> wrote:
    >
    >> Suppose you have two lists:
    >>
    >> a, b, c, d, e, f, g
    >>
    >> and
    >> a, b, e, g
    >>
    >> and you want to extract only the items on the first list that are not on
    >> the second list.
    >>
    >> I tried =IF(A1<>$B1:$B8,A1)
    >>
    >> and also
    >>
    >> {=IF(A1<>$B1:$B8,A1)}
    >>
    >> neither worked, any suggestions?
    >>
    >> Thanks,
    >> Les




  79. #79
    Leslie Coover
    Guest

    Re: Extract only items not on previous list

    Thanks Ron, this works good

    When there is an id field and an associated name field this method can
    extract only the records in list 1(columns A and B) that do not appear in
    list 2 (columns C and D) and then print the result in say columns G and H.
    This is a big help.
    Thanks,

    Les

    "Ron Rosenfeld" <[email protected]> wrote in message
    news:[email protected]...
    > On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]>
    > wrote:
    >
    >>Not sure what you mean?
    >>
    >>A1:A6 = {a, b, c, d, e, f}
    >>B1:B3 = {a, d, f}
    >>
    >>how should I reorganize the data to use the formula
    >>=COUNTIF($A$9:$A$11,B9)=0
    >>as a criteria in an advance filter and what should I enter in
    >>List Range box?
    >>
    >>Thanks.

    >
    > OK , you've reversed your lists. And you do have to have things laid out
    > in a
    > defined way to get the advanced filter to work. Here's one way.
    >
    > I assume that the result you want is {b,c,e}.
    >
    > Set up a worksheet as follows
    >
    > A B
    > List1 List2
    > a a
    > b d
    > c f
    > d
    > e
    > f
    >
    > (In columns A & B; and Rows 1-7; note that a header row is used)
    >
    > E1: <empty>
    > E2: =COUNTIF($B$2:$B$4,A2)=0
    >
    > Data/Filter/Advanced Filter
    > Action: Copy to another location
    > List Range: $A$1:$B$7
    > Criteria Range: $E$1:$E$2
    > Copy to: G1
    > <OK>
    >
    > In columns G & H you will see:
    >
    > List1 List2
    > b d
    > c f
    > e
    >
    > You are only interested in List1 so you can either delete H1:H3 or copy
    > column
    > G to wherever. Or set things up to display the results some other way.
    >
    > The above could also be done using a macro. Probably you should use the
    > macro
    > recorder if you choose this option.
    >
    >
    >
    > --ron




  80. #80
    Domenic
    Guest

    Re: Extract only items not on previous list

    Make sure that this part of the formula...

    INDEX('01.0A'!$A$1:$A$6

    ....is changed to...

    INDEX('01.0A'!A$1:A$6

    Therefore, your formulas should be as follows...

    A1:

    =SUMPRODUCT(--(COUNTIF('01.0B'!$A$1:$A$2,'01.0A'!$A$1:$A$6)=0))

    B1, copied down and across:

    =IF(ROWS(B$1:B1)<=$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    1:$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),R
    OWS(B$1:B1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

    In article <GGfKe.399$U92.87@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Thanks Domenic, I could not get the results I wanted, it simply displayed
    > the same id numbers
    > repeatedly, rather than including data in adjacent cells.
    >
    > If I had really huge data sets your method is definitely superior as results
    > can be printed on one worksheet
    > and the "long list" and "short list" can be kept in two other worksheets.
    > I'm sure there is a way to extract data in adjacent cells along with primary
    > key data, but the data sets I am concerned with are not that large so I
    > decided to use Ron's filter method (in this thread). To use that method all
    > the data must be kept on one sheet (there may be a way to use multiple
    > sheets here too--but I do not know it). The advantage is that the extracted
    > records can contain data in adjacent cells along with the primary data key.
    >
    > Les
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    > > Try...
    > >
    > > B1, copied down and across:
    > >
    > > =IF(ROWS(B$1:B1)<$A$1,INDEX('01.0A'!A$1:A$6,SMALL(IF(COUNTIF('01.0B'!$A$1
    > > :$A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),RO
    > > WS(B$1:B1))),"")
    > >
    > > Note that the column reference for...
    > >
    > > INDEX('01.0A'!A$1:A$6
    > >
    > > ...has been changed to a relative reference.
    > >
    > > Hope this helps!
    > >
    > > In article <rf4Ke.353$U92.195@okepread06>,
    > > "Leslie Coover" <[email protected]> wrote:
    > >
    > >> Okay so far so good
    > >> Now I have the "long" data in sheet 01.0A and the "short" data in
    > >> sheet 01.0B used basically the same SUMPRODUCT formula in sheet 01.0C
    > >>
    > >> and used
    > >>
    > >> =IF(ROWS($B$1:B1)<$A$1,INDEX('01.0A'!$A$1:$A$6,SMALL(IF(COUNTIF('01.0B'!$A$
    > >> 1:$
    > >> A$2,'01.0A'!$A$1:$A$6)=0,ROW('01.0A'!$A$1:$A$6)-ROW('01.0A'!$A$1)+1),ROWS($
    > >> B$1
    > >> :B1))),"")
    > >>
    > >> This works allright, but it only lists the id # for each record, I want
    > >> all
    > >> the data for the whole record (column A to column D) what do I need to
    > >> change?
    > >>
    > >> Here is an example, if want
    > >>
    > >> W3245 peach 358 red
    > >> W2178 lemmon 548 yellow
    > >>
    > >> but I only get
    > >>
    > >> W3245
    > >> W2178
    > >>
    > >> I know I could concatanate all the data in each record so it fits into
    > >> just
    > >> one cell, but is there an easier way?
    > >>
    > >> Les


  81. #81
    Domenic
    Guest

    Re: Extract only items not on previous list

    Assuming that Column A contains your first list, and Column B contains
    your second list, try...

    C1:

    =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))

    D1, copied down:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    ....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

    Hope this helps!

    In article <byUJe.308$U92.51@okepread06>,
    "Leslie Coover" <[email protected]> wrote:

    > Suppose you have two lists:
    >
    > a, b, c, d, e, f, g
    >
    > and
    > a, b, e, g
    >
    > and you want to extract only the items on the first list that are not on
    > the second list.
    >
    > I tried =IF(A1<>$B1:$B8,A1)
    >
    > and also
    >
    > {=IF(A1<>$B1:$B8,A1)}
    >
    > neither worked, any suggestions?
    >
    > Thanks,
    > Les


  82. #82
    Leslie Coover
    Guest

    Extract only items not on previous list

    Suppose you have two lists:

    a, b, c, d, e, f, g

    and
    a, b, e, g

    and you want to extract only the items on the first list that are not on
    the second list.

    I tried =IF(A1<>$B1:$B8,A1)

    and also

    {=IF(A1<>$B1:$B8,A1)}

    neither worked, any suggestions?

    Thanks,
    Les



  83. #83
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 23:28:35 -0500, "Leslie Coover" <[email protected]> wrote:

    >Thanks Ron, this works good
    >
    >When there is an id field and an associated name field this method can
    >extract only the records in list 1(columns A and B) that do not appear in
    >list 2 (columns C and D) and then print the result in say columns G and H.
    >This is a big help.
    >Thanks,


    Glad to help. Thank you for the feedback.
    --ron

  84. #84
    Biff
    Guest

    Re: Extract only items not on previous list

    Hi!

    The formula works but the example you posted originally is the opposite of
    the example you just posted. So, just reverse some of the references:

    =IF(ROWS($D$1:D1)<=$C$1,INDEX($B$1:$B$6,SMALL(IF(COUNTIF($A$1:$A$3,$B$1:$B$6)=0,ROW($B$1:$B$6)-ROW($A$1)+1),ROWS($D$1:D1))),"")

    Array entered.

    Biff

    "Leslie Coover" <[email protected]> wrote in message
    news:_xWJe.327$U92.24@okepread06...
    > When I used your formulas a 3 was generated in cell C1 and zeros in D1:D3
    >
    > Here is the data
    > A1:A3 {a, d, f}
    > B1:B6 {a, b, c, d, e, f}
    >
    > I want the items in B1:B6 that don't appear in A1:A3
    >
    > Tried to use a Vlookup and If function and it worked but was cumbersome.
    >
    > How about this VBA code solution?
    >
    > Create an outside loop that steps through each item in the long list.
    > Create an inside loop that steps through each item on the short list
    >
    > If there is no match the active cell is printed in an adjacent cell. If
    > there is a match
    > the inside loop terminates and the outside loop increments to the next
    > item on the list.
    >
    > And so it goes until the last item on the long list is checked.
    >
    > Could someone give me some help with this code?
    >
    > Les
    >
    > "Domenic" <[email protected]> wrote in message
    > news:[email protected]...
    >> Assuming that Column A contains your first list, and Column B contains
    >> your second list, try...
    >>
    >> C1:
    >>
    >> =SUMPRODUCT(--(COUNTIF($B$1:$B$4,$A$1:$A$7)=0))
    >>
    >> D1, copied down:
    >>
    >> =IF(ROWS($D$1:D1)<=$C$1,INDEX($A$1:$A$7,SMALL(IF(COUNTIF($B$1:$B$4,$A$1:$
    >> A$7)=0,ROW($A$1:$A$7)-ROW($A$1)+1),ROWS($D$1:D1))),"")
    >>
    >> ...confirmed with CONTROL+SHIFT+ENTER, not just ENTER.
    >>
    >> Hope this helps!
    >>
    >> In article <byUJe.308$U92.51@okepread06>,
    >> "Leslie Coover" <[email protected]> wrote:
    >>
    >>> Suppose you have two lists:
    >>>
    >>> a, b, c, d, e, f, g
    >>>
    >>> and
    >>> a, b, e, g
    >>>
    >>> and you want to extract only the items on the first list that are not on
    >>> the second list.
    >>>
    >>> I tried =IF(A1<>$B1:$B8,A1)
    >>>
    >>> and also
    >>>
    >>> {=IF(A1<>$B1:$B8,A1)}
    >>>
    >>> neither worked, any suggestions?
    >>>
    >>> Thanks,
    >>> Les

    >
    >




  85. #85
    Ron Rosenfeld
    Guest

    Re: Extract only items not on previous list

    On Tue, 9 Aug 2005 11:03:16 -0500, "Leslie Coover" <[email protected]> wrote:

    >Not sure what you mean?
    >
    >A1:A6 = {a, b, c, d, e, f}
    >B1:B3 = {a, d, f}
    >
    >how should I reorganize the data to use the formula
    >=COUNTIF($A$9:$A$11,B9)=0
    >as a criteria in an advance filter and what should I enter in
    >List Range box?
    >
    >Thanks.


    OK , you've reversed your lists. And you do have to have things laid out in a
    defined way to get the advanced filter to work. Here's one way.

    I assume that the result you want is {b,c,e}.

    Set up a worksheet as follows

    A B
    List1 List2
    a a
    b d
    c f
    d
    e
    f

    (In columns A & B; and Rows 1-7; note that a header row is used)

    E1: <empty>
    E2: =COUNTIF($B$2:$B$4,A2)=0

    Data/Filter/Advanced Filter
    Action: Copy to another location
    List Range: $A$1:$B$7
    Criteria Range: $E$1:$E$2
    Copy to: G1
    <OK>

    In columns G & H you will see:

    List1 List2
    b d
    c f
    e

    You are only interested in List1 so you can either delete H1:H3 or copy column
    G to wherever. Or set things up to display the results some other way.

    The above could also be done using a macro. Probably you should use the macro
    recorder if you choose this option.



    --ron

+ 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