Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 7
Default Comparing two lists in Excel

Hi guys,

I am hoping someone can have me come up with a formula:

It might be best to lay it out so here is what my spreadsheet looks like:

ID Amount ID Amount
1234 $100 4213 $80
2134 $80 1234 $100
3124 $120 2134 $80
4213 $100 4412 $60

If it helps, I am doing a reconciliation. Essentially, if the ID exists in both lists and is the same, then it's fine and nothing needs to happen (in the above example, that would be for ID 1234 and 2134). However, if an ID is only on one list or if the amounts are not equal, I want it to be flagged.

I was trying to do two separate vlookups and then compare but I have been left scratching my head. Can anyone suggest any ideas on what the best approach is?

Your help would be greatly appreciated.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 829
Default Comparing two lists in Excel

"Ada33" wrote:
ID Amount ID Amount
1234 $100 4213 $80
2134 $80 1234 $100
3124 $120 2134 $80
4213 $100 4412 $60

If it helps, I am doing a reconciliation. Essentially, if
the ID exists in both lists and is the same, then it's fine
and nothing needs to happen (in the above example, that
would be for ID 1234 and 2134). However, if an ID is only
on one list or if the amounts are not equal, I
want it to be flagged.


Suppose your data are in columns A and B on the left and columns D and E on
the right, with the titles in row 1.

Enter the following formulas into the indicated cells and copy down as
needed.

C2: =IF(A2="","",
IF(AND(COUNTIF($A$2:$A$1000,A2)=1,COUNTIF($D$2:$D$ 1000,A2)=1),
IF(VLOOKUP(A2,$D$2:$E$1000,2,0)=B2,"","ERROR"),"ER ROR"))

F2: =IF(D2="","",
IF(AND(COUNTIF($A$2:$A$1000,D2)=1,COUNTIF($D$2:$D$ 1000,D2)=1),
IF(VLOOKUP(D2,$A$2:$B$1000,2,0)=E2,"","ERROR"),"ER ROR"))

This assumes each ID should appear only once in each column, and the amounts
should be the same.

If you want to allow for multiple appearances of the same ID and only the
total of each sum should be the same (partial invoices and partial payments,
not necessarily a one-to-one match), try the following:

C2: =IF(A2="","",
IF(AND(COUNTIF($A$2:$A$1000,A2)=1,COUNTIF($D$2:$D $1000,A2)=1),
IF(SUMIF($A$2:$A$1000,A2,$B$2:$B$1000)=SUMIF($D$2: $D$1000,A2,$E$2:$E$1000),
"","ERROR"),"ERROR"))

F2: =IF(A2="","",
IF(AND(COUNTIF($A$2:$A$1000,D2)=1,COUNTIF($D$2:$D $1000,D2)=1),
IF(SUMIF($A$2:$A$1000,D2,$B$2:$B$1000)=SUMIF($D$2: $D$1000,D2,$E$2:$E$1000),
"","ERROR"),"ERROR"))

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
Comparing lists in Excel/Visual Basic [email protected] Excel Programming 5 April 12th 08 03:57 PM
comparing two lists in excel petevang Excel Discussion (Misc queries) 3 April 7th 06 04:37 AM
Comparing 2 Excel Lists and Appending if entries are in both [email protected] Excel Discussion (Misc queries) 3 February 8th 06 04:17 PM
Comparing two lists in excel that don't match exactly Tina Excel Worksheet Functions 2 May 11th 05 05:00 PM
Comparing Lists to Partial Lists depuyus[_7_] Excel Programming 0 August 5th 04 01:43 PM


All times are GMT +1. The time now is 08:10 PM.

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

About Us

"It's about Microsoft Excel"