Solved

comparing 2 columns

Posted on 2014-09-10
4
75 Views
Last Modified: 2014-09-25
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
Comment
Question by:pma111
4 Comments
 
LVL 21

Expert Comment

by:Randy Poole
ID: 40314194
Not quite sure what you are asking for here. Can you give an example
0
 
LVL 49

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 167 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 32

Accepted Solution

by:
Rob Henson earned 167 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

by:tomfarrar
tomfarrar earned 166 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now