+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Identifying Duplicates and adding a value in to a column

  1. #1
    Registered User
    Join Date
    05-18-2012
    Location
    North Carolilna
    MS-Off Ver
    Excel 2007
    Posts
    20

    Identifying Duplicates and adding a value in to a column

    Good morning,

    Is there a way to look in column A for duplicates and if it finds one, look at a second column and if that column contains a certain text string put a * (or any character) in another column.

    So in the example I have attached when in column A it finds a duplicate it then looks to column B and column B contains "Setup" it would return a * in column D.

    Thanks in advance!
    Dedee
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Identifying Duplicates and adding a value in to a column

    Try:

    =IF(AND(B2="Setup",COUNTIF(A$2:A2,A2)>1),"*","")

    copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    05-18-2012
    Location
    North Carolilna
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Identifying Duplicates and adding a value in to a column

    So to help me learn instead of just copying your formula (which works beautifully by the way)...

    Count if A2 matches any other value in column A then the if statement says if it's greater >1 (from the counting) return a value of * otherwise return a value of blank.

    The only situation it doesn't cover is identifying the column that contains "Setup". As in my example if the data is sorted then the one with "United States" in Column B becomes the one with the * and I'd prefer if the one containing setup in Column B is the one with the *. Or if it's easier could it identify all duplicates but give each set of duplicates a unique character or number return in colum D.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Identifying Duplicates and adding a value in to a column

    Again, you were too quick and I had updated my formula when I realized you wanted the "Setup" condition included.

    The formula checks that the count of column A from top to current position of formula as you copy down is greater than 1 (ie. duplicate) and that b2 is "Setup".

  5. #5
    Registered User
    Join Date
    05-18-2012
    Location
    North Carolilna
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Identifying Duplicates and adding a value in to a column

    Thank you!

    If it contains Setup but does not equal Setup how would that change the formula because the field might be Setup Frank Johns or Setup John Williams etc...

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Identifying Duplicates and adding a value in to a column

    Perhaps:

    =IF(AND(LEFT(B2,5)="Setup",COUNTIF(A$2:A2,A2)>1),"*","")

    or

    =IF(AND(ISNUMBER(SEARCH("Setup",B2)),COUNTIF(A$2:A2,A2)>1),"*","")

    the first checks if first 5 characters spell "Setup". The second checks if "Setup" is anywhere in cell B2....

  7. #7
    Registered User
    Join Date
    05-18-2012
    Location
    North Carolilna
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Identifying Duplicates and adding a value in to a column

    Thanks much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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