+ Reply to Thread
Results 1 to 3 of 3

Need help in comparing two tables

  1. #1
    Registered User
    Join Date
    12-30-2014
    Location
    Mumbai
    MS-Off Ver
    2007
    Posts
    15

    Need help in comparing two tables

    Hi All,

    I have a issue in comparing two tables. Any assistance will be appreciated.

    I have two tables as below,

    Table 1:
    Invoice -- Fees
    101 -- 25.5
    102 -- 30
    103 -- 35
    104 -- 65
    105 -- 90
    106 -- 123
    107 -- 23

    Table 2:
    Invoice -- Fees
    101 -- 35
    102 -- 20
    103 -- 35
    104 -- 65
    105 -- 90
    106 -- 13
    107 -- 23

    So I have two table with common invoice numbers but with changes amount for some invoices. I need a formula which I can use to filter out the invoice numbers with different amount. So from the above tables, the out put should show the result of 101, 102 and 106.

    Can anyone please assist me?

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Need help in comparing two tables

    I'm assuming that your "tables" aren't actual tables but instead simply a 2-column range (we can adjust the formula if this assumption is wrong).

    With your first "table" in A1:B8 (headers in row 1) and your second "table" in D1:E8 (headers in row 1), if the same invoice numbers are in the same row, try this:

    =IFERROR(INDEX(A$2:A$8,SMALL(IF(B$2:B$8<>E$2:E$8,ROW(B$2:B$8)-(ROW(B$2)-1)),ROWS(A$1:A1))),"") Ctrl Shift Enter

    Drag the formula down until you get blank cells.

    See attachment for clarification.
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Need help in comparing two tables

    Attached creates an "unmatched" table that identifies the same invoice numbers with different values in the two tables.

    Neither list needs to be in sequential order.

    The Invoice number identifier in Col L uses Table 1 as the base:
    =IF(INDEX($D$3:$D$9,MATCH(A3,$A$3:$A$9,0))=INDEX($I$3:$I$9,MATCH(A3,$F$3:$F$9,0)),"",A3)

    Col M then uses Index Match to match the relevant values from Table 1 where there is something in Col L:
    =IF($L3<>"",INDEX(D$3:D$9,MATCH($L3,A$3:A$9,0)),"")

    Col N then uses Index Match to match the relevant values from Table 2 where there is something in Col L:
    =IF($L3<>"",INDEX(I$3:I$9,MATCH($L3,F$3:F$9,0)),"")

    Although you didn't suggest you could have "unique" invoice numbers in either column, need to note that this approach won't list any invoice in either table that does not appear in the other.

    If you want it to do that, I would personally recommend using a small Macro that could run down both tables and identify any and all variations and post them sequentially into the third table.

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 10-12-2017 at 04:19 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Comparing the two tables
    By stribor40 in forum Excel General
    Replies: 4
    Last Post: 12-26-2015, 06:14 AM
  2. [SOLVED] Help Comparing two tables
    By Snaybot in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2014, 01:17 PM
  3. Comparing between tables
    By harold12 in forum Excel General
    Replies: 1
    Last Post: 01-23-2014, 06:33 PM
  4. comparing tables
    By day92 in forum Access Tables & Databases
    Replies: 4
    Last Post: 12-21-2010, 08:26 PM
  5. Comparing Tables
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-18-2010, 12:24 PM
  6. [SOLVED] Comparing 2 Tables
    By carl in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-06-2006, 09:40 PM
  7. Comparing two tables
    By Peter Steiner in forum Excel General
    Replies: 6
    Last Post: 12-23-2005, 06:15 AM

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