Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# comparing 2 columns

Posted on 2014-09-10
Medium Priority
83 Views
I have got a set of data returned from a query – exported to excel. I have 2 rows of data I need to “compare”, they are called invoice_num and invoice_ID. If a unique invoice_num appears in 20 consecutive rows – there should also be a unique invoice_ID which should also appear in the same 20 rows.
i.e.

invoice_num             invoice_id
12345                  34567
12345                  34567
12345                  34567
55555                  99999
55555                  99999
12348                  50006
12348                  50006

As it stands invoice_num is in column A and invoice_ID is in column B. I presume an additioanl column i.e. Z that has some sort of summary would be fine. An exception would be if you have unique invoice_num but different invoice_ID on different rows, and vice versa.
0
Question by:pma111
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 21

Expert Comment

ID: 40314194
Not quite sure what you are asking for here. Can you give an example
0

LVL 52

Assisted Solution

Rgonzo1971 earned 668 total points
ID: 40314214
Hi,

pls try

=IF(SUM(IF(FREQUENCY((\$A\$2:\$A\$8=A2)*(\$B\$2:\$B\$8),(\$A\$2:\$A\$8=A2)*(\$B\$2:\$B\$8))>0,1))-2+SUM(IF(FREQUENCY((\$B\$2:\$B\$8=B2)*(\$A\$2:\$A\$8),(\$B\$2:\$B\$8=B2)*(\$A\$2:\$A\$8))>0,1))-2,"Not OK","OK")

Regards
EE20140910.xlsx
0

LVL 33

Accepted Solution

Rob Henson earned 668 total points
ID: 40314269
Assuming data in columns A & B, the following formula in column C will give blank for first occurence of Invoice or TRUE or FALSE depending whether the Invoice ID matches the first occurence:

=IFERROR(B2=VLOOKUP(A2,\$A\$1:B1,2,FALSE),"")

Copy into C2 and then copy down. The lookup range will extend as you copy down. You can then filter for FALSE to get those that don't match.

Thanks
Rob H
0

LVL 7

Assisted Solution

tomfarrar earned 664 total points
ID: 40315200
If this is an ongoing requirement you could make a table out of the two columns and create two linked pivot tables, one with column A left-most row and one with column B left-most row ( in traditional pivot table format) and the abnormal combinations will visually stand out.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
###### Suggested Courses
Course of the Month5 days, 20 hours left to enroll