View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Comparing 2 Tables

"carl" wrote:
.. assumes that table A and B have the same row and column headers.
that is not the case in my case.


Perhaps one way using OFFSET which might do it here ..

A sample construct is available at:
http://www.savefile.com/files/3721756
Comparing 2 tables.xls

Source tables (Tables A and B) assumed in Sheet1, Sheet2
with Box#s listed in B1 across, references in A2 down

In a new Sheet3 ("Table C"),
Box#s listed in B1 across, references in A2 down (same structure)

Placed in B2, B2 copied across & filled down to populate:
=IF(OR(ISNA(OFFSET(Sheet2!$A$1,MATCH($A2,Sheet2!$A :$A,0)-1,MATCH(B$1,Sheet2!$1:$1,0)-1)),
ISNA(OFFSET(Sheet1!$A$1,MATCH($A2,Sheet1!$A:$A,0)-1,MATCH(B$1,Sheet1!$1:$1,0)-1))),"--",
IF(OFFSET(Sheet2!$A$1,MATCH($A2,Sheet2!$A:$A,0)-1,MATCH(B$1,Sheet2!$1:$1,0)-1)
=OFFSET(Sheet1!$A$1,MATCH($A2,Sheet1!$A:$A,0)-1,MATCH(B$1,Sheet1!$1:$1,0)-1),"OK","Check"))

The formulas filled area is then conditionally formatted (with B2 active)
using Formula is: =B2="Check"

Above will return:
"--" if box# & reference is not found in either or both source sheets
"Check" if box# & reference is found in both source sheets and the
intersection value does not tally
"OK" if box# & reference is found in both source sheets and the intersection
value ("1") tallies
[The CF will trigger & format cells with "Check" returned, as an added visual]

The listing sequence for both box#s (in B1 across) and references (in A1
down) in all 3 sheets is immaterial. Box#s and references listed in any one
sheet are presumed unique, of course.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---