+ Reply to Thread
Results 1 to 4 of 4

Formula to compare 2 columns for a given number in another column

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    charlotte, nc
    MS-Off Ver
    Excel 2013
    Posts
    11

    Formula to compare 2 columns for a given number in another column

    Hi guys,

    So I have a sample spreadsheet attached. Keep in mind this spreadsheet will be long so the formula can't be hard coded data. What I am looking for is this:

    You have the following:

    Column B - SSN
    Column G - Length of Acct #
    Column H - Last 2 digits of Acct #

    IF for a given SSN in Column B (the normal spreadsheet will have MANY SSNs so formula needs to be dynamic), the person has a 01 in Column H and a 16 in Column B then I want the text "Review" in column E on the first row for that SSN.

    In the full spreadsheet, some SSNs may have 3 rows of data and some may have 15 so the formula needs to be able to look through each row for a given SSN, then look to see if 01 and 16 are both present and then put "Review" in Column E.

    Thanks for the help!
    Attached Files Attached Files
    Last edited by igotgame; 10-07-2021 at 01:39 PM.

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

    Re: Formula to compare 2 columns for a given number in another column

    This doesn't really match your explanation in post #1 and you have not filled in any expected results (manually):

    AliGW on MS365 Insider (Windows) 32 bit
    A
    B
    C
    D
    E
    F
    G
    H
    1
    memnum
    ssn
    dob
    acctnum
    Review
    Length of Acct#
    Last 2 digits of Acct#
    firstname
    2
    999999999
    123456789
    1012021
    555551L0001
    11
    01
    3
    999999999
    123456789
    1012021
    544441L0016
    11
    16
    4
    999999999
    123456789
    1012021
    4433004447778888
    16
    91
    Sheet: Sheet1
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-07-2012
    Location
    charlotte, nc
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Formula to compare 2 columns for a given number in another column

    I've updated the original post with the spreadsheet updated to be more clear.

    I just want "REVIEW" in the first row/cell in Column E corresponding to that SSN if the other conditions are met.
    Last edited by igotgame; 10-07-2021 at 01:40 PM.

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Formula to compare 2 columns for a given number in another column

    this is guess work as the columns in your description do not match the spreadhsheet

    Are lines for an account consecutive, if so
    E2
    =IF(AND(COUNTIFS($B$2:$B$100,B2,$G$2:$G$100,"01")*COUNTIFS($B$2:$B$100,B2,$F$2:$F$100,"16")>0,B2<>B1),"Review","")

+ 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: 16
    Last Post: 08-29-2021, 01:20 PM
  2. 2 Columns - Compare columns and give a percentage of number of matches
    By Dave1969 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-24-2020, 06:55 AM
  3. [SOLVED] Lookup formula to find last number in a column and compare to the cell above.
    By A440 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-23-2019, 07:32 AM
  4. Replies: 11
    Last Post: 01-19-2018, 05:43 AM
  5. Replies: 6
    Last Post: 09-21-2016, 04:21 PM
  6. [SOLVED] Compare columns, replace matching number with reference number and fill down random amount
    By datadigger in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-04-2012, 10:53 PM
  7. compare columns and count number of matching columns
    By san000 in forum Excel General
    Replies: 1
    Last Post: 07-15-2009, 10:31 PM

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