+ Reply to Thread
Results 1 to 9 of 9

Percentage of one column based on set data of another column

  1. #1
    Registered User
    Join Date
    08-27-2009
    Location
    earth, earth
    MS-Off Ver
    Excel 2007
    Posts
    3

    Percentage of one column based on set data of another column

    I have a large spreadsheet that has over 400 people on it and over 60 columns per person. Each of those columns has dates that each person has completed a certain portion of training. The first Colum has Either a 'Yes' or 'No' to indicate if they count towards our group or if they are just temporarily attached to us administratively and do not count towards our training numbers. I need to find the percentage of personel who count towards our training that have completed a certain task. Basically I need a formula that will only count if a cell has data in it if there is a 'Yes' in the colum to the left of it. Any formula I've used so far has included the 'No's in it's calculations, so some fields have been off by over 30%. Any help would be appreciated.

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

    Re: Percentage of one column based on set data of another column

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    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
    08-27-2009
    Location
    earth, earth
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Percentage of one column based on set data of another column

    Sorry, i've attached a sample. Now I know I can filter out the 'No' column to get the # of 'Yes' columns, then filter to get the number of personnel without blanks and do the math that way, but that takes too much time and I'd have to do it every time I remove or add new people. I'd like it to automatically update whenever I remove or add someone, which is why I wanted a formula to do it.

    If you look at the spreadsheet, there are 5 'No's on the side. so there are only 15 'Yes's. If all 15 people completed the training, the percentage should say 100%. but any that say 'no' still get counted, so it will give me 133% instead. I don't want the ones with a 'No' in the first field to count in any calculations.
    Attached Files Attached Files

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

    Re: Percentage of one column based on set data of another column

    In D23, try:

    =SUMPRODUCT(--($A$2:$A$21="yes"),--ISNUMBER(C$2:C$21))/COUNTA($A$2:$A$21)

    copied across and format as percentage.

  5. #5
    Registered User
    Join Date
    08-27-2009
    Location
    earth, earth
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Percentage of one column based on set data of another column

    I tried using that formula and got 0% as the answer. when I fill in the other fields in the example worksheet, I receive 50.00%, 60.00%, 65.00%, 65.00%, 35.00%, 55.00%, 65.00% and 70.00%.

    I looked at the formula and I thought that the C$2:C$21 was a typo and changed it to D$2:D$21 and got 50% as a result. But using a calculator I should receive 53.33% as a result. I'm not the most technologically savvy person in the world, so this is really confusing me. Any more help would be appreciated.

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

    Re: Percentage of one column based on set data of another column

    Yes, should've been, in D23:

    =SUMPRODUCT(--($A$2:$A$21="yes"),--ISNUMBER(D$2:D$21))/COUNTA($A$2:$A$21)

    I get 50% since there are 10 "Yes's" with a date in column D.. and there are 20 Yes/No entries... so 10/20=50

    Is that not what you need?

    If no, how did you come up with your number of 53%?

    and if you want to get percent Yes with dates over percent date entries, then I get 10/13 or 76.92% using this formula:

    =SUMPRODUCT(--($A$2:$A$21="yes"),--ISNUMBER(D$2:D$21))/SUMPRODUCT(--ISNUMBER(D$2:D$21))
    Last edited by NBVC; 08-27-2009 at 03:30 PM.

  7. #7
    Registered User
    Join Date
    07-16-2012
    Location
    Colorado
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Percentage of one column based on set data of another column

    I am looking to do something similar to the above poster. Although I would like everything in column A which is equal to query to then match up with contents in Colums (E10-J271) then calculate the pass/fail percentage. I've attached the document for further details
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    05-13-2008
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    17

    Re: Percentage of one column based on set data of another column

    HI Cavman,

    try "=COUNTIFS($A$2:$A$21,"Yes",D2:D21,">0")/COUNTIF($A$2:$A$21,"YES")"

    I don't get your 53.33% for column D - but looking at it there are 15 people marked Yes, 10 of whom have complete training for Equal Opportunity = 66.67%

    Hope this helps.

    Tim

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Percentage of one column based on set data of another column

    nherman,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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