+ Reply to Thread
Results 1 to 9 of 9

Need to calculate percentage of an occurrence

  1. #1
    Registered User
    Join Date
    09-23-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    27

    Need to calculate percentage of an occurrence

    I have a set of data in which there are values of 0's and 1's. I'm trying to determine what the percentage of occurrence is when a 1 immediately follows a zero. I've attached an example of the data. Any and all help is greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Need to calculate percentage of an occurrence

    You will need to tell us what your expected outcome for that set of data is and why.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    09-23-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Need to calculate percentage of an occurrence

    This set of data is part of a larger data set in which the values of 0 and 1 represent a loss or a win for sales team performance. I'm trying to determine what the percentage of losses are followed by a win.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,409

    Re: Need to calculate percentage of an occurrence

    Yes, I understand that. So, based on the sample data you've given us, what are you expecting that percentage to be?

  5. #5
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Need to calculate percentage of an occurrence

    Hi All,

    I don't know which denominator could be the correct one

    maybe

    =COUNTIFS($A$1:$A$39,1,A$2:A$40,0)/COUNTA($A1:$A40)

    or

    =COUNTIFS($A$1:$A$39,1,A$2:A$40,0)/COUNTIFS($A$1:$A$40,1)

    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  6. #6
    Registered User
    Join Date
    09-23-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Need to calculate percentage of an occurrence

    Thank you canapone, I believe the first formula is correct. Now my next issue, is that I am running this report daily and have two separate worksheets that I'm using. One as the data and two for analysis. My data sheet has over 150K's and grows daily. My employee's are listed in columns A on both sheets and the data being analyzed with the formula above in in column G on sheet "DALL". So my formula's live on sheet "TOP" and my data is on sheet "DALL" with row 1 in both sheets being used as headers, hence the reason all start on row 2. With that said, here is the formula I am using, but still is not working. I'm not extremely knowledgeable with regards to formulas so again thank you for any and all assistance.

    =COUNTIFS(DALL!$A$2:$A$299999,TOP!$A2,DALL!$G$2:$G$299998,1,DALL!$G$2:$G$299999,0)/COUNTA(DALL!$A$2:$A$299999,TOP!$A2,DALL!$G$2:$G$299999)

  7. #7
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Need to calculate percentage of an occurrence

    Hi,

    a question: why are you matching the content of A2?


    Ranges should have same extension

    =COUNTIFS(DALL!$A$2:$A$299998,TOP!$A2,DALL!$G$2:$G$299998,1,DALL!$G$3:$G$299999,0)/COUNTA(DALL!$A$2:$A$299999,TOP!$A2,DALL!$G$2:$G$299999)

    Top!A2 cannot be compared in COUNTA, maybe denominator could be adjusted this way


    =COUNTIFS(DALL!$A$2:$A$299998,TOP!$A2,DALL!$G$2:$G$299998,1,DALL!$G$2:$G$299999,0)/(COuntif(DALL!$A$2:$A$299999,TOP!$A2)+COUNTA(DALL!$G$2:$G$299999))


    A small sample file would be helpful.


    Regards
    Last edited by canapone; 04-12-2017 at 11:42 AM.

  8. #8
    Registered User
    Join Date
    09-23-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    27

    Re: Need to calculate percentage of an occurrence

    Perhaps I was wrong in my initial explanation and anticipated outcome. Attached is my workbook being used, without all of the irrelevant data and formulas. What I'm trying to determine is what is the percentage of losses followed by wins. For example:
    Employee: 21popolig
    Number of records: 504
    Total Wins: 251
    Total Losses: 242
    Total undetermined (blank): 11

    Of the 242 losses, 126 are followed by a win; which would put the percentage of wins after loss at 52%? This did not include losses followed by (blank) followed by a win (which totaled 3).
    Using the formula below and only the data pertaining to employee "21popolig" on sheet "21popolig", I got the same answer... So my question is how can I convert this formula into sheet "Top"?

    =COUNTIFS($A$1:$A$503,1,A$2:A$504,0)/COUNTIFS($A$1:$A$504,0)
    Attached Files Attached Files
    Last edited by sm370; 04-12-2017 at 01:38 PM. Reason: attachment wasn't included

  9. #9
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Need to calculate percentage of an occurrence

    Hi

    first number should be 131

    =SUMPRODUCT(--(DALL!$A$2:$A$42095&DALL!$C$2:$C$42095&DALL!C$3:$C$42096=A2&"01"))


    Hope it's a little step forward.
    Attached Files Attached Files

+ 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. [SOLVED] Trying to calculate most recent occurrence of a particular value
    By MarcD2k15 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-17-2015, 08:24 AM
  2. Need a formula to count occurrence of text and calculate a sum total
    By tgaito in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-30-2014, 01:55 PM
  3. [SOLVED] Calculate occurrence/thousand from table
    By karl8695 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-12-2013, 06:27 AM
  4. Replies: 2
    Last Post: 11-16-2013, 05:19 PM
  5. [SOLVED] Percentage Occurrence (Possibly Frequency function)
    By adrem7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-08-2013, 06:33 PM
  6. Calculating percentage occurrence of numbers
    By jordi55 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2012, 10:43 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