Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 55
Default Compare list of number between two columns

I have two columns with a list of numbers in each. I need to compare the
list in column A to the list in column B and produce a list of numbers that
is in A but not in B. Can that be done by using a formula?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Compare list of number between two columns

Try this:

Assume the range is A1:B10 and there are no empty cells within the range.

Enter this formula** in C1. This will return the count of numbers that meet
the criteria.

=SUMPRODUCT(--(ISNA(MATCH(A1:A10,B1:B10,0))))

Enter this array formula** in D1 and copy down until you get blanks. This
will extract the numbers that meet the criteria.

=IF(ROWS(D$1:D1)<=C$1,INDEX(A$1:A$10,SMALL(IF(ISNA (MATCH(A$1:A$10,B$1:B$10,0)),ROW(A$1:A$10)-MIN(ROW(A$1:A$10))+1),ROWS(D$1:D1))),"")

Or, you could combine both formulas into a single array formula** :

=IF(ROWS(D$1:D1)<=SUM(--(ISNA(MATCH(A$1:A$10,B$1:B$10,0)))),INDEX(A$1:A$10 ,SMALL(IF(ISNA(MATCH(A$1:A$10,B$1:B$10,0)),ROW(A$1 :A$10)-MIN(ROW(A$1:A$10))+1),ROWS(D$1:D1))),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)


--
Biff
Microsoft Excel MVP


"Theresa" wrote in message
...
I have two columns with a list of numbers in each. I need to compare the
list in column A to the list in column B and produce a list of numbers
that
is in A but not in B. Can that be done by using a formula?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,290
Default Compare list of number between two columns

This will omit duplicate entries, however It does leave "blank" cells is the list.
Data in A1:B10...

=IF(AND(COUNTIF($B$1:$B$10,A1)=0,COUNTIF($A$1:A1,A 1)=1),A1,"")
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Theresa"
wrote in message
I have two columns with a list of numbers in each. I need to compare the
list in column A to the list in column B and produce a list of numbers that
is in A but not in B. Can that be done by using a formula?
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare multiple column of data and list out common and unique component in adj columns kuansheng Excel Worksheet Functions 15 February 1st 06 10:49 PM
Compare 2 columns, and create a list of items that are in both lists ruby2sdy Excel Worksheet Functions 3 October 8th 05 11:04 AM
How can I compare a number against a list of numbers johnny Excel Worksheet Functions 4 March 22nd 05 07:13 PM
Compare columns PiedmontJohn Excel Discussion (Misc queries) 4 January 7th 05 12:08 AM


All times are GMT +1. The time now is 12:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"