+ Reply to Thread
Results 1 to 5 of 5

Calculate defects separated with comma? Need urgent help please

  1. #1
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Wisbech England
    MS-Off Ver
    Excel 2010
    Posts
    308

    Calculate defects separated with comma? Need urgent help please

    Hi All,
    I've been trying to find a solution for my issue but despite multiple attempts I have failed.
    After about a month and a half of persistent failures, I've decided to ask you good people for help :-)

    I did managed to find a solution that works but it has one major limitation which I cannot live with ;-)
    Ok so he's what I'm trying to do:
    Attached is a sample data containing records for product testing, you'll see bunch of columns but the ones I'm interested in are:Location, Date Collected, BUName,Mastercode,Fail Reason.
    Here's the catch, Fail Reason has 1 or more defect in the same cell separated by comma, what I need is a pivot table or something similar that would count percentage of defects (Fail Reasons) per product, my current solution does this but the way it is built it prevents from using filter on date and this is that one major limitation.

    I haven't probably explained this properly, All I need is the ability to somehow calculate percentage of defects per product and use remaining fields as means of filtering.

    Thank You
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Calculate defects separated with comma? Need urgent help please

    Not sure if this help, just trying.

    J1 head is #fail reason

    J2 for count fail reason on J2 that separate with comma.

    =IF(LEN(G2),LEN(G2)-LEN(SUBSTITUTE(G2,",",""))+1,)

    I summarize with Pivot table, which I just know some basic.
    There will be 1 case with 2 fail reasons that will make percentage of 200%.
    So I'm not sure how to work with this.
    Attached Files Attached Files

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Calculate defects separated with comma? Need urgent help please

    Looking at your Fail;s Reason, I see quite a few inconsistencies in the codes. Can these be eliminated at all?
    G10=Heavy rust marks identified. This arrival was quality sorted.
    G102=heavy rust marks
    G104=heavy rusk marks

    G199=Rots
    G203=rot

    G299=GREENING
    G315=STORE GREENING

    G309=EYES OPEN
    G564=EYES OPENING

    etc (there are more)

    If this were me, I would try to break that column out into separate reasons, then base your summaries on those
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Contributor
    Join Date
    08-29-2011
    Location
    Wisbech England
    MS-Off Ver
    Excel 2010
    Posts
    308

    Re: Calculate defects separated with comma? Need urgent help please

    Thank You both for taking your time to help me out, really appreciate this.
    FDibbins you are absolutely correct, fail reasons are defined in another table. Reason for "G10=Heavy rust marks identified. This arrival was quality sorted" and other inconsistent records comes from earlier version of the system where fail reason field was a free text but now it has drop down boxes with predifined list of defects.
    There are currently total of 45 defect in my table and these are the only ones calculations should be run on (anything else that's not in defect table should not be taken into consideration)
    I'd like to be able add more defect in the future and I'm sure as the system grows this will indeed be the case.
    Defects:
    rot
    mould
    sprouting
    external re-growth
    greening
    Internal Browning
    Gel breakdown
    waste
    Shrivel
    Sunken lesion
    Stem End Rot
    Speckling
    Hard Rot
    Internal defects
    Waste
    soft/ spongy
    collapsed fruit
    Bruising
    Rots
    Mouldy Crowns
    Overmature
    Rotten Crown
    Mealy bug
    heavy rusk marks
    Spots
    Internal brownig
    Black Spots
    BLACK SPOT
    Pest Damage
    Internal Damage
    Splits
    Slipskin
    Running juices
    Dead berries
    Waterberries
    Bladdery
    rots/mould
    PSD
    Pitting
    Collapsing rot
    Shrivelled/dehydrated fruit
    RBD
    Blind waste
    SERB
    Degreening Burn

    Thank You

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Calculate defects separated with comma? Need urgent help please

    You still have some inconsistencies in that list, eg you have a code for Internal brownig, Internal Browning, Internal Damage and Internal defects

    As well as BLACK SPOT and Black Spots

    Anyway, I put your list in Pivot sheet starting in L23.
    M4=COUNTIF(Sheet1!$G$1:$G$1368,"*"&L4&"*")
    copied down

    See how that works for you, and thanks for the feedback

+ 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. Use Macro to calculate DPU (Defects per unit) with respect to associate in monthly basis
    By crazyarun2004 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-19-2017, 04:43 AM
  2. Comma separated string
    By ESF in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-20-2011, 06:39 AM
  3. calculate comma separated value in a cell
    By rsdharan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-14-2009, 02:21 PM
  4. Comma separated values
    By shrikantk in forum Excel General
    Replies: 3
    Last Post: 05-18-2009, 09:52 AM
  5. Invert last name / first name (not comma separated)
    By Kieranc in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-30-2008, 04:30 AM
  6. Comma Separated Value
    By matrixknow in forum Excel General
    Replies: 2
    Last Post: 05-22-2007, 07:10 AM
  7. Comma Separated - Help Please
    By endit in forum Excel General
    Replies: 2
    Last Post: 10-11-2006, 06:11 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