Verify rows within column A match and then verify rows in a column B match

1. Verify rows within column A match and then verify rows in a column B match

I'm trying to build a formula that will consider if the data in column A matches and then if it does I need the formula to consider if the data in column B matches. If column A matches and column B also matches then I need a column C that defines these as a match. If column A matches and column B does not match then I need a column C that defines these as not matching.

I got close with this formula =IF(COUNTIFS(\$A\$2:\$A\$15000,\$A2)*TRUE,"1","0")+AND(B2<>B3), but excel is not considering the rows exclusively and so I ran into an issue with rows 6 & 7 as counting to meet the conditions, but the number in column A does not match between rows 6 and 7.

A B C
1 Number Status Match
2 1018584 1 N
3 1018584 0 N
4 1019528 1 Y
5 1019528 1 Y
6 1031125 1 N
7 1031168 0 N

2. Re: Verify rows within column A match and then verify rows in a column B match

Welcome to the forum!

Try this:

=COUNTIFS(\$A\$2:\$A\$15000,\$A2,\$B\$2:\$B\$15000,\$B2)>1

3. Re: Verify rows within column A match and then verify rows in a column B match

Thanks for helping with this question. The formula (=COUNTIFS(\$A\$2:\$A\$15000,\$A2,\$B\$2:\$B\$15000,\$B2)>1) gave the results below. The formula seems to work if there are only two rows with the same number in A, but if there are more than two rows with the same number in A the formula doesn't work.

See lines 3-5, 12-16. I'm expecting a false anytime the value in A matches and there is an instance of 0 and 1 in B.

I just need to know the number of times there is an instance of 0 and 1 (column b) with a matching number (column A) so if there is a totally different approach to this question please feel free to suggest.

A B C
1 1018584 1 FALSE
2 1018584 0 FALSE
3 1021470 1 TRUE
4 1021470 1 TRUE
5 1021470 0 FALSE
6 1024340 1 FALSE
7 1024340 0 FALSE
8 1025010 1 FALSE
9 1025010 0 FALSE
10 1025220 1 FALSE
11 1025220 0 FALSE
12 1026298 1 TRUE
13 1026298 1 TRUE
14 1026298 0 FALSE
15 1026298 1 TRUE
16 1026298 1 TRUE

4. Re: Verify rows within column A match and then verify rows in a column B match

Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

2. Make sure that your desired results are also shown (mock up the results manually).

3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

4. Try to avoid using merged cells as they cause lots of problems.

Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.

5. Re: Verify rows within column A match and then verify rows in a column B match

Here is a sample file as requested. I cut the sample to 100 rows for simplicity.

6. Re: Verify rows within column A match and then verify rows in a column B match

This works on your new sample data (in C2 copied down):

=OR(COUNTIFS(\$A1:\$A2,\$A2,\$B1:\$B2,0)=1,AND(A2=A1,B1=0,COUNTIFS(\$A1:\$A2,\$A2,\$B1:\$B2,1))=1)

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

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