Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

comparing 2 columns

Posted on 2014-09-10
4
Medium Priority
?
85 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 53

Assisted Solution

by:Rgonzo1971
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 34

Accepted Solution

by:
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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
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.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
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…

927 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