PC Review


Reply
Thread Tools Rate Thread

array formula to extract members of list A that are not in list B

 
 
miniforexTrader@gmail.com
Guest
Posts: n/a
 
      8th Feb 2008
Hi,

Lets say I have data in a range A1:A5 that contains
"A","B","C","D","E" in each cell respectively. In Range B1:B3, the
values are "A","D","E".

I want to be able to extract the "B" and "D" using array formula.

I created a formula {=MATCH(A1:A5,B1:B3,0)} which creates a list of
numbers (index value of the location of the matches in the list) where
there are matches and #N/A where there are no matches. I want to be
able to pull out the #N/A index location so that I can identify the
"B" and then the "D", perhaps using a Small function but I have gotten
stuck....

Please advise.

TIA

 
Reply With Quote
 
 
 
 
T. Valko
Guest
Posts: n/a
 
      8th Feb 2008
<(E-Mail Removed)> wrote in message
news:ca379907-e9d8-4b06-8997-(E-Mail Removed)...
> Hi,
>
> Lets say I have data in a range A1:A5 that contains
> "A","B","C","D","E" in each cell respectively. In Range B1:B3, the
> values are "A","D","E".
>
> I want to be able to extract the "B" and "D" using array formula.
>
> I created a formula {=MATCH(A1:A5,B1:B3,0)} which creates a list of
> numbers (index value of the location of the matches in the list) where
> there are matches and #N/A where there are no matches. I want to be
> able to pull out the #N/A index location so that I can identify the
> "B" and then the "D", perhaps using a Small function but I have gotten
> stuck....
>
> Please advise.
>
> TIA
>


> I want to be able to extract the "B" and "D"


Shouldn't that be "B" and "C"?

Enter this array formula in D1 and copy down until you get #NUM! errors
meaning all data has been extracted:

=INDEX(A$1:A$5,SMALL(IF(COUNTIF(B$1:B$3,A$1:A$5)=0,ROW(A$1:A$5)-MIN(ROW(A$1:A$5))+1),ROWS(D$11)))

--
Biff
Microsoft Excel MVP


 
Reply With Quote
 
Dave D-C
Guest
Posts: n/a
 
      9th Feb 2008
How about
{=IF(ISNA(MATCH(A1:A5,B1:B3,0)),A1:A5,"")}
Dave D-C


(E-Mail Removed) wrote:
>Hi,
>
>Lets say I have data in a range A1:A5 that contains
>"A","B","C","D","E" in each cell respectively. In Range B1:B3, the
>values are "A","D","E".
>
>I want to be able to extract the "B" and "D" using array formula.
>
>I created a formula {=MATCH(A1:A5,B1:B3,0)} which creates a list of
>numbers (index value of the location of the matches in the list) where
>there are matches and #N/A where there are no matches. I want to be
>able to pull out the #N/A index location so that I can identify the
>"B" and then the "D", perhaps using a Small function but I have gotten
>stuck....
>
>Please advise.
>
>TIA


 
Reply With Quote
 
miniforexTrader@gmail.com
Guest
Posts: n/a
 
      12th Feb 2008
On Feb 9, 12:24*pm, Dave D-C <dacrom...@wyoming.kom> wrote:
> How about
> {=IF(ISNA(MATCH(A1:A5,B1:B3,0)),A1:A5,"")}
> Dave D-C
>

Hi Dave D-C

This solution requires a formula to be dragged the entire length of
the table being checked - it is an okay solution but not where I
wanted to go with this.

The correct application of this solution would utilize absolute
addresses for the range $B$1:$B$3 and for the $A$5 and relative
adresses for the A1 so that it checks each value in A as you copy down
the list.

={IF(ISNA(MATCH(A1:$A$5,$B$1:$B$3,0)),A1:$A$5,"")}

Thanks for your interest.
 
Reply With Quote
 
miniforexTrader@gmail.com
Guest
Posts: n/a
 
      12th Feb 2008
On Feb 8, 2:45*pm, "T. Valko" <biffinp...@comcast.net> wrote:
> <miniforexTra...@gmail.com> wrote in message
>
> news:ca379907-e9d8-4b06-8997-(E-Mail Removed)...
>
>
>
>
>
> > Hi,

>
> > Lets say I have data in a range A1:A5 that contains
> > "A","B","C","D","E" in each cell respectively. *In Range B1:B3, *the
> > values are "A","D","E".

>
> > I want to be able to extract the *"B" and "D" using array formula.

>
> > I created a formula * {=MATCH(A1:A5,B1:B3,0)} which creates a list of
> > numbers (index value of the location of the matches in the list) where
> > there are matches and #N/A where there are no matches. *I want to be
> > able to pull out the #N/A index location so that I can identify the
> > "B" and then the "D", perhaps using a Small function but I have gotten
> > stuck....

>
> > Please advise.

>
> > TIA

>
> > I want to be able to extract the *"B" and "D"

>
> Shouldn't that be "B" and "C"?
>
> Enter this array formula in D1 and copy down until you get #NUM! errors
> meaning all data has been extracted:
>
> =INDEX(A$1:A$5,SMALL(IF(COUNTIF(B$1:B$3,A$1:A$5)=0,ROW(A$1:A$5)-MIN(ROW(A$1*:A$5))+1),ROWS(D$11)))
>
> --
> Biff
> Microsoft Excel MVP- Hide quoted text -
>
> - Show quoted text -


Thanks Biff - this is the type of solution I was looking for - solves
the base problem exactly how I envisioned.

Do you have a way to prevent the return of duplicates in Column A -
say you had "A","B","C","D","E","A","B" -

Is there a way we could ad a countif to check the solution set (those
cells that are in the range from the first row of the solution to the
row above the current row as well as check B1:B3 (criteria range)?

Thanks again.
 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      12th Feb 2008
<(E-Mail Removed)> wrote in message
news:82f6de97-aead-4a0f-8997-(E-Mail Removed)...
On Feb 8, 2:45 pm, "T. Valko" <biffinp...@comcast.net> wrote:
> <miniforexTra...@gmail.com> wrote in message
>
> news:ca379907-e9d8-4b06-8997-(E-Mail Removed)...
>
>
>
>
>
> > Hi,

>
> > Lets say I have data in a range A1:A5 that contains
> > "A","B","C","D","E" in each cell respectively. In Range B1:B3, the
> > values are "A","D","E".

>
> > I want to be able to extract the "B" and "D" using array formula.

>
> > I created a formula {=MATCH(A1:A5,B1:B3,0)} which creates a list of
> > numbers (index value of the location of the matches in the list) where
> > there are matches and #N/A where there are no matches. I want to be
> > able to pull out the #N/A index location so that I can identify the
> > "B" and then the "D", perhaps using a Small function but I have gotten
> > stuck....

>
> > Please advise.

>
> > TIA

>
> > I want to be able to extract the "B" and "D"

>
> Shouldn't that be "B" and "C"?
>
> Enter this array formula in D1 and copy down until you get #NUM! errors
> meaning all data has been extracted:
>
> =INDEX(A$1:A$5,SMALL(IF(COUNTIF(B$1:B$3,A$1:A$5)=0,ROW(A$1:A$5)-MIN(ROW(A$1*:A$5))+1),ROWS(D$11)))
>
> --
> Biff
> Microsoft Excel MVP- Hide quoted text -
>
> - Show quoted text -


Thanks Biff - this is the type of solution I was looking for - solves
the base problem exactly how I envisioned.

Do you have a way to prevent the return of duplicates in Column A -
say you had "A","B","C","D","E","A","B" -

Is there a way we could ad a countif to check the solution set (those
cells that are in the range from the first row of the solution to the
row above the current row as well as check B1:B3 (criteria range)?

Thanks again.
**********

I'm not sure I understand what you want but to prevent duplicates from being
entered in a range you can use data validation.

Assume the range of interest is A1:A10
Select the range A1:A10
Goto the menu Data>Validation
Allow: Custom
Formula: =COUNTIF(A$1:A$10,A1)<=1
OK

--
Biff
Microsoft Excel MVP


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing Object Members In An Array List -- Syntax & Guidelines Help Please José Joye Microsoft C# .NET 8 13th Feb 2008 08:35 PM
Excel formula to extract a group of data from another list CTR Microsoft Excel Worksheet Functions 2 11th Jan 2007 09:35 PM
Extract name of members from a distribution list Rekha Microsoft Outlook Contacts 3 27th Sep 2004 08:48 PM
Outlook clients can not list global distribution list members TK Microsoft Outlook 0 1st Jun 2004 08:08 PM
WinXP clients can not list Outlook distribution list members Lynn Windows XP General 0 1st Jun 2004 08:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:34 PM.