+ Reply to Thread
Results 1 to 6 of 6

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

  1. #1
    Registered User
    Join Date
    04-10-2019
    Location
    Oregon
    MS-Off Ver
    1808
    Posts
    3

    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

    Your advice is appreciated. Thanks!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,690

    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
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-10-2019
    Location
    Oregon
    MS-Off Ver
    1808
    Posts
    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. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,690

    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. #5
    Registered User
    Join Date
    04-10-2019
    Location
    Oregon
    MS-Off Ver
    1808
    Posts
    3

    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.
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,690

    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)

+ 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. Replies: 6
    Last Post: 09-03-2015, 09:51 PM
  2. Formula to Verify/Match Strings of text
    By jav171 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-29-2015, 01:56 PM
  3. [SOLVED] Verify if two numbers in sequence (Rows)
    By elsg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-17-2014, 09:15 AM
  4. Match string in one column, return value in same row, skip rows that down't match
    By anilsen0711 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2013, 05:35 AM
  5. [SOLVED] Find string in Column A then verify Date in Column B
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-17-2012, 07:13 PM
  6. [SOLVED] Excel 2007 : Match Syntax - Verify My Understanding
    By CatherineCarey in forum Excel General
    Replies: 2
    Last Post: 04-19-2012, 03:10 PM
  7. Match and verify data in 2 sheets
    By nobin999 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-01-2010, 08:53 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