+ Reply to Thread
Results 1 to 28 of 28

Repair formula that show winning percentage of a variable?

  1. #1
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Repair formula that show winning percentage of a variable?

    I use this formula to calculate the winning percentage of a certain variable , the total number is 21 with 7 wins and 12 loses and two 0s, the result 7/21 should be 33,33%, but is showing 36,84%. How can i repair the formula?


    " =COUNTIF(sheet1!Q4:Q60;">0")/COUNTIF(sheet1!Q4:Q60;"<>0") "

  2. #2
    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,926

    Re: Repair formula that show winning percentage of a variable?

    Q4:Q60 is not 21 rows? Perhaps you have other values inside that range that you are not looking at?
    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

  3. #3
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    Hi,
    The only rows filled are Q4:Q24 the rest is blank , i have two 0s that might be affecting the result.

  4. #4
    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,926

    Re: Repair formula that show winning percentage of a variable?

    Try changing the ranges to just what you need, because yes, those 2 0's are more than likely being included, although that should reduce the %, not increase it.

    7/23 = 30.4%

  5. #5
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    I have tested the formula without 0s and it worked showing 33,33%. Do i need a new formula to ignore the 0s or maybe its possible to modify this one?

  6. #6
    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,926

    Re: Repair formula that show winning percentage of a variable?

    I just re-ran your calc from post 1.

    Your formula
    =COUNTIF(sheet1!Q4:Q60;">0")/COUNTIF(sheet1!Q4:Q60;"<>0")
    is completely ignoring the 0 (ties?), so you are only counting a max of 19 entries, not 21
    7/19 = 36.8%

    Try this instead...
    =COUNTIF(sheet1!Q4:Q60;">0")/COUNTa(sheet1!Q4:Q60)
    Although, I would still prefer you used the actyal ranges.

  7. #7
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    The total range is Q4:Q60 but only Q4:Q24 is filled, the formula is including the blank cells, is showing 12,28% as result.

  8. #8
    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,926

    Re: Repair formula that show winning percentage of a variable?

    What formula did you use?
    Is there a formula in those "blank" cells - ie where do the results come from?
    Will there always be 21 entries?
    Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

  9. #9
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    I use this formula "=COUNTIF(sheet1!Q4:Q60;">0")/COUNTa(sheet1!Q4:Q60)" , The original formula was intended to count only the positive number from range Q4:Q60 but the 0s are affecting the result, so i just want to ignore the 0s, Q4:Q60 have a formula that calculate the numbers positive or negative. So i just want the formula to ignore the 0s and also the cells without a number.

  10. #10
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    This is a workbook sample.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    And sorry for the late reply.

  12. #12
    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,926

    Re: Repair formula that show winning percentage of a variable?

    1. You have 8 >0 not 7
    2. excluding blanks/zeros, you have a total of 19, not 21
    3. 8/19 = 42.1%
    =COUNTIF(F4:F24,">0")/COUNTIF(F4:F24,"<>0")

    OR if you want to exclude zero from ONLY numerator and NOT the denominator (which I believe is incorrect)...
    8/21 = 38.1%

  13. #13
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    I counted 7 >0 from G4:G24, and the result 7/21 should be 33,33%.

  14. #14
    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,460

    Re: Repair formula that show winning percentage of a variable?

    There are zeroes in two of the cells (G13 and G23) conditionally formatted not to appear. Remove them and you will get the result you require.
    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.

  15. #15
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    I will need the 0s, its possible to ignore the 0s, and count only numbers above 0, so that the result 7/21 is 33,33?

  16. #16
    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,926

    Re: Repair formula that show winning percentage of a variable?

    No, you have 8, not 7

    A4 385
    A5 800
    A6 5
    A7 520
    A14 390
    A16 75
    A18 95
    A20 220

  17. #17
    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,460

    Re: Repair formula that show winning percentage of a variable?

    Change the formula in G4 to this and drag down:

    =IF(F4="","",IFERROR(F4*E4/5,0))

    Then use this:

    =COUNTIF(G4:G60,">"&0)/COUNT(G4:G60)
    Last edited by AliGW; 10-21-2018 at 02:00 AM.

  18. #18
    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,460

    Re: Repair formula that show winning percentage of a variable?

    There are 8 in green - Ford is correct:

    Excel 2016 (Windows) 32 bit
    E
    F
    G
    3
    Quantity TOTAL $
    4
    1
    385
    77
    5
    1
    800
    160
    6
    1
    5
    1
    7
    1
    520
    104
    8
    1
    -90
    -18
    9
    1
    -90
    -18
    10
    1
    -5
    -1
    11
    1
    -135
    -27
    12
    1
    -20
    -4
    13
    1
    0
    0
    14
    1
    390
    78
    15
    1
    -60
    -12
    16
    1
    75
    15
    17
    1
    -85
    -17
    18
    1
    95
    19
    19
    1
    -80
    -16
    20
    1
    220
    44
    21
    1
    -75
    -15
    22
    1
    -150
    -30
    23
    1
    0
    0
    24
    1
    -105
    -21
    Sheet: Sheet1

  19. #19
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    My sheet is altered , i am so sorry about that

    For me:

    F16 = 75 AND G16 =-15 instead of 15

    so just please consider G15 AS -15
    Last edited by Mr.Castle; 10-21-2018 at 02:00 AM.

  20. #20
    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,460

    Re: Repair formula that show winning percentage of a variable?

    See post #17.

  21. #21
    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,460

    Re: Repair formula that show winning percentage of a variable?

    Excel 2016 (Windows) 32 bit
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    3
    Quantity TOTAL $
    4
    1
    385
    77
    5
    1
    800
    160
    Porcentage of winning numbers:
    33.33%
    6
    1
    5
    1
    7
    1
    520
    104
    8
    1
    -90
    -18
    9
    1
    -90
    -18
    10
    1
    -5
    -1
    11
    1
    -135
    -27
    12
    1
    -20
    -4
    13
    1
    0
    0
    14
    1
    390
    78
    15
    1
    -60
    -12
    16
    1
    -75
    -15
    17
    1
    -85
    -17
    18
    1
    95
    19
    19
    1
    -80
    -16
    20
    1
    220
    44
    21
    1
    -75
    -15
    22
    1
    -150
    -30
    23
    1
    0
    0
    24
    1
    -105
    -21
    Sheet: Sheet1


    Excel 2016 (Windows) 32 bit
    G
    4
    =IF(F4="","",IFERROR(F4*E4/5,0))
    5
    =COUNTIF(G4:G60,">"&0)/COUNT(G4:G60)
    Sheet: Sheet1

  22. #22
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    I am getting the result as 14,81% instead of 8/21 which is 38.09%, is the formula including 0s?

  23. #23
    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,460

    Re: Repair formula that show winning percentage of a variable?

    Please see attached.
    Attached Files Attached Files

  24. #24
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    This is a sample workbook with the new formula.
    Attached Files Attached Files

  25. #25
    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,460

    Re: Repair formula that show winning percentage of a variable?

    You need to drag copy the formula in G4 right down to G60.

  26. #26
    Forum Contributor
    Join Date
    07-09-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    257

    Re: Repair formula that show winning percentage of a variable?

    Problem solved, the formula worked.
    Thank you, so much for your help

  27. #27
    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,460

    Re: Repair formula that show winning percentage of a variable?

    No problem.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  28. #28
    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,926

    Re: Repair formula that show winning percentage of a variable?

    As long as you got where you wanted to be

+ 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 Solver to show optimal percentage outcome of multiple formula
    By mattmurray81 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-02-2018, 05:20 AM
  2. Turning a percentage round to show the remaining percentage
    By tjb333 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-02-2018, 10:51 AM
  3. [SOLVED] Calculate formula to show price difference & percentage
    By Coventry G in forum Excel General
    Replies: 6
    Last Post: 05-09-2016, 11:55 AM
  4. [SOLVED] Formula to show value AND percentage saved
    By coreytroy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-27-2013, 11:55 AM
  5. [SOLVED] Formula to Show Percentage Amount
    By FrumpyJones in forum Excel General
    Replies: 2
    Last Post: 04-02-2012, 01:38 PM
  6. [SOLVED] Formula to show percentage
    By Ortz in forum Excel General
    Replies: 2
    Last Post: 03-20-2012, 08:29 PM
  7. Custom formula to show each item as percentage of grand total?
    By RoryMacLeod in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-07-2005, 10:49 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