+ Reply to Thread
Results 1 to 9 of 9

Identifying rows with similar criteria

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    Oxford
    MS-Off Ver
    Excel 2010
    Posts
    57

    Identifying rows with similar criteria

    Hi Everyone

    I'm trying to work out the best way to identify combinations of values using a basic set of criteria

    The criteria is that column A will have a list of products and column B will have a list of sizes - what I want to do is either highlight or identify where 2 lines in column A that match have a different size in column B

    For example - in the below I want to show that apple and cherry have 2 different size

    Column A - Column B

    Apple Small
    Apple Medium
    Banana Medium
    Banana Medium
    Cherry Medium
    Cherry Small

    I'm not sure how to make that link between the 2 matching products vs the difference in column B

    There is only 2 criteria (small & medium) but column A will have lots of different products

    Thanks for any help or advice

    Dan_B

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Identifying rows with similar criteria

    Dan- The formula is easy. What do want to do with the result? A sample workbook / mocked-up version showimg what you're after would be helpful. For example, I could Highlight any qualified products within the main list, or build a separate list.
    Last edited by leelnich; 05-15-2017 at 05:45 AM.

  3. #3
    Registered User
    Join Date
    01-13-2010
    Location
    Oxford
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Identifying rows with similar criteria

    Hi Leelnich

    Thanks for the quick response - I've attached a sample file which shows basically what I'd need to identify products falling under that critieria however your idea for putting them into a separate list would save a lot more filtering etc

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Identifying rows with similar criteria

    Try

    C2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Drag down
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Identifying rows with similar criteria

    OK, just to get it out there, here's a simple validation formula you can paste in C2 and copy down:
    =(COUNTIFS(B:B,"Small",A:A,$A2)*COUNTIFS(B:B,"Medium",A:A,$A2))>0

    NOTE: You could also apply it in Conditional Formatting to highlight the rows of interest.

    The separate list will take a bit longer...

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Identifying rows with similar criteria

    c2=IF(COUNTIF($A$2:$A$9,$A2)<>COUNTIFS($A$2:$A$9,$A2,$B$2:$B$9,$B2),"duplicate product with different size","")
    Try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  7. #7
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Identifying rows with similar criteria

    For highlighting

    select A2:C9 and then press Alt->O->D ->>New rule->>use a formula to determine which cells to format->>> use this =COUNTIFS($A:$A,$A2,$B:$B,$B2)=1 formula in formula section the select the format as you want then ok.

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Identifying rows with similar criteria

    or
    =IFERROR(INDEX(C$1:C1,MATCH(A2,A$1:A1,0)),IF(COUNTIF($A$2:$A$9,$A2)<>COUNTIFS($A$2:$A$9,$A2,$B$2:$B$9,$B2),"duplicate product with different size",""))
    try this and copy towards down

  9. #9
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Identifying rows with similar criteria

    OK, Dan, here's your workbook with a list of "Dual-Sized Products" in Column E. I defined the following 2 dynamic Named Ranges:
    (These adjust to changes in List size.)

    Product =OFFSET(Sheet1!$A$1,1,0,COUNTA(Sheet1!$A:$A)-1)
    Size =OFFSET(Sheet1!$B$1,1,0,COUNTA(Sheet1!$B:$B)-1)

    ...and here's the ARRAY FORMULA that creates the list:
    =IFERROR(INDEX(Product,MATCH(0,COUNTIF($E$1:$E2,Product)+(COUNTIFS(Product,Product,Size,"Small")*COUNTIFS(Product,Product,Size,"Medium")=0),0),1),"")

    NOTE: When pasting an ARRAY FORMULA in the formula bar, you must press CTRL+SHIFT+ENTER to confirm entry.
    Then use the drag handle to copy it down as far as needed.


    DUALSZ.png

    Hope this fits the bill.-Lee

    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Attached Files Attached Files
    Last edited by leelnich; 05-15-2017 at 10:49 AM.

+ 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. Need help identifying the 'latest' string from multiple strings with similar content
    By mkatkins in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-17-2016, 04:06 PM
  2. [SOLVED] Identifying similar rows for deletion
    By svetic in forum Excel General
    Replies: 3
    Last Post: 06-23-2014, 06:25 PM
  3. [SOLVED] Excel 2010 Identifying data changed in cells and Identifying the changed rows
    By SandyLake in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-13-2013, 01:12 AM
  4. Identifying Similar Dates
    By wawa in forum Excel General
    Replies: 5
    Last Post: 05-09-2012, 04:56 PM
  5. Identifying Similar Cells
    By mintribe in forum Excel General
    Replies: 2
    Last Post: 12-20-2011, 02:38 PM
  6. Identifying almost similar cells
    By VBnoob in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-14-2011, 07:39 AM
  7. Replies: 2
    Last Post: 06-08-2006, 02:00 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