+ Reply to Thread
Results 1 to 15 of 15

Customer Number vs Customer Names

  1. #1
    Registered User
    Join Date
    05-01-2020
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    39

    Customer Number vs Customer Names

    Hi,
    I need to flag where a Customer Number, (that is supposed to be a matching Duplicate Row) is not matching a Duplicate Customer Name, therefore I need to create a field called "Cust Num Error"

    See attachment example.

    On a Customer Name level, I want to flag the following:
    1 is where the Customer duplicate Names - will have matching duplicate Cust Numbers
    0 is where the Customer duplicate Names - will not have matching duplicate Cust Numbers
    Anything other scenario, should be flagged Null

    I tried using this formula, but it is just giving me all 1's
    =(COUNTIFS(A:A,A2,B:B,B2)=COUNTIF(A:A,A2))*1

    Thanks in advance
    Attached Files Attached Files
    Last edited by MarkJohn51; 06-10-2020 at 07:43 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    40,644

    Re: Customer Number vs Customer Names

    Your problem is that your data is inconsistent. Try this in any free cell just as an example:

    =A2=A3
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    UK
    MS-Off Ver
    various
    Posts
    1,852

    Re: Customer Number vs Customer Names

    based on your sample, I think you need to account for the anomalies (per prior post) but also your equality test should, seemingly, be based upon Name rather than Number.

    =0+(COUNTIFS($A$2:$A$9,TRIM($A2)&" *",$B$2:$B$9,$B2)=COUNTIF($B$2:$B$9,$B2))

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    40,644

    Re: Customer Number vs Customer Names

    This will work once the data has been cleaned:

    =(COUNTIF(A:A,A2)=COUNTIF(B:B,B2))*1

  5. #5
    Registered User
    Join Date
    05-01-2020
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    39

    Re: Customer Number vs Customer Names

    Quote Originally Posted by XLent View Post
    based on your sample, I think you need to account for the anomalies (per prior post) but also your equality test should, seemingly, be based upon Name rather than Number.

    =0+(COUNTIFS($A$2:$A$9,TRIM($A2)&" *",$B$2:$B$9,$B2)=COUNTIF($B$2:$B$9,$B2))
    Many thanks...your formula works when:
    1 is where the Customer duplicate Names - has matching duplicate Cust Numbers
    0 is where the Customer duplicate Names - does not have matching duplicate Cust Numbers

    However, what do I need to include in this formula for any other Scenario, that will output a Null ?
    For Example: when there is just One Customer Number row = One Customer name (no Duplicates rows)? I want this cell to be a Null
    Last edited by MarkJohn51; 06-10-2020 at 08:41 AM.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    40,644

    Re: Customer Number vs Customer Names

    You seem to be ignoring the elephant in the room ...

  7. #7
    Registered User
    Join Date
    05-01-2020
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    39

    Re: Customer Number vs Customer Names

    Column A data has been trimmed, and True, if this is what you are referring to?

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    40,644

    Re: Customer Number vs Customer Names

    I am referring to the inconsistent data, yes. You should tackle this directly rather than trying to compensate for it in a formula.

    My suggestion should work for the scenario mentioned in your last post. How about sharing an updated workbook with more detailed (clean!) data?

  9. #9
    Registered User
    Join Date
    05-01-2020
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    39

    Re: Customer Number vs Customer Names

    This is my test data..my real data is Trimmed and clean.

    Thanks for your suggestions, though for other scenarios (for example where the Customer name instances are different per Cust Number, I want these to be Null - the last 3 rows of my data in "Cust Name Check" field).
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    40,644

    Re: Customer Number vs Customer Names

    Sorry - please explain why these should be null:

    Excel 2016 (Windows) 32 bit
    A
    B
    20
    00413402Q YOLA ESCADA
    21
    00413402Q YOLE ESCADA
    22
    00413402Q YOLE ESCADA
    Sheet: Sheet1

  11. #11
    Registered User
    Join Date
    05-01-2020
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    39

    Re: Customer Number vs Customer Names

    It should be Null, because there is an instance of the Customer Name, not consistent (B20) with a matching (Duplicate) Customer Number.

    The purpose of my new field is to flag with 0, where a "duplicate" Customer Number (A) has an error and does not relate to a matching duplicate Customer Name (B)...as can occur as seen in other rows of my data.
    Where they match I want to flag as a 1

    Any other Customer (such as above B20 to B22) will be Null.
    Last edited by MarkJohn51; 06-10-2020 at 12:14 PM.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    40,644

    Re: Customer Number vs Customer Names

    Just wondering why you started this thread when you have one already that is driving more or less at the same thing ...

    https://www.excelforum.com/excel-gen...er-number.html

  13. #13
    Registered User
    Join Date
    05-01-2020
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    39

    Re: Customer Number vs Customer Names

    That thread is another field that I am looking at to output differences between non matching Customer Name rows, within that Customer Number (not a flag).

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    40,644

    Re: Customer Number vs Customer Names

    OK. I'm going offline shortly, so hopefully others will pick this one up.

  15. #15
    Registered User
    Join Date
    05-01-2020
    Location
    Ireland
    MS-Off Ver
    2013
    Posts
    39

    Re: Customer Number vs Customer Names

    Thanks for your help and suggestions

+ 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. Generate a separate staff customer list based on larger customer table
    By CARROLLJP in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-15-2018, 04:40 PM
  2. Replies: 4
    Last Post: 11-28-2014, 07:53 AM
  3. using pan number of the customer find details of an customer using excel macros
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2014, 03:31 PM
  4. [SOLVED] Pulling the customer name when I enter the customer number
    By c.seely in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-04-2012, 01:12 PM
  5. replace customer number with customer name
    By openyamind in forum Excel General
    Replies: 3
    Last Post: 11-10-2011, 06:59 PM
  6. Customer Names into Customer List
    By dustin470 in forum Excel General
    Replies: 2
    Last Post: 02-13-2010, 08:52 AM
  7. Replies: 1
    Last Post: 07-07-2006, 02:10 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