We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Excel calculation question

Niv
Niv Posts: 2,566 Forumite
Part of the Furniture 1,000 Posts Name Dropper
I want to work out a percentage in a range but if the return for one of the rows is zero i want to exclude it from the percentage calculation. Data set below to show what i have at the moment. What I want is the last entry to be disregarded because the return is zero. I know I could manually change the formula to exclude it but this will be used on a document that others will be using and they will not 'remember' or more concerning 'know' how to do it.
I am thinking that maybe I could use an if statement in the max available column so if weighted score is 0 then max score is zero. Would that maybe be the easiest way?
Any tips appreciated. 

Weighted Score Overall Maximum Available
35 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
48 48
0 48
899 960
Overall percentage  94%
YNWA

Target: Mortgage free by 58.

Comments

  • WaywardDriver
    WaywardDriver Posts: 546 Forumite
    Seventh Anniversary 500 Posts
    edited 20 March 2020 at 8:51AM
    If values in columns A and B then enter the formula =SUM(A:A)/SUMIF(A:A,">0",B:B) in cell C1 say.
    Edited to correct error in formula.
  • Niv
    Niv Posts: 2,566 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Thats great thank you so much 
    WaywardDriver said:
    If values in columns A and B then enter the formula =SUM(A:A)/SUM(A:A,">0",B:B) in cell C1 say.

    YNWA

    Target: Mortgage free by 58.
  • Heedtheadvice
    Heedtheadvice Posts: 2,801 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Niv, do take care with such summing methods where a whole column is used. It is very easy to inadvertantly have a value in a column that ought not be part of the calculation such as above or even well below the data set. Even more important if the sheet is being used by inexperienced persons!
    Not familiar with that particular way of summing with specific criteria. The more common/understood way is to use the sumif function, designed to sum only values that meet formula defined criterium see https://support.office.com/en-us/article/sumif-function-169b8c99-c05c-4483-a712-1697a653039b
     or on that same page under See Also sumifs for multiple criteria.
  • Niv
    Niv Posts: 2,566 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Thanks for the heads up, it will be a hidden tab with the answer displayed elsewhere, believe me that is enough to stop them but I will also password protect the sheet.

    YNWA

    Target: Mortgage free by 58.
  • Sorry - formula should be =SUM(A:A)/SUMIF(A:A,">0",B:B)
    Yes agree should be careful when summing whole column although Excel will ignore non-numeric values.
  • Heedtheadvice
    Heedtheadvice Posts: 2,801 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Glad you corrected the formula o wayward one. I thought I had missed something!! :)
    Niv, if that is your answer to the security required then instead of having a sheet 'tab' hidden...just have it on another workbook that your other users do not have access to or is hidden to them. You can even move the sheet you have developed to the separate workbook....or alternatively have the user input sheets on their own?

    There are advantages to that approach in that, for example, you can update/change your 'percentage' workbook ('offline') without affecting the user sheet(s) and just replace you working version with the new modified one!
  • Niv
    Niv Posts: 2,566 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    OMG, I cant let users input sheets on their own they would seriously fail. I get queries asking me where their name is on the list only for me to repeatedly have to tell them 'there is a filter on the list, just change it on the drop-down'... I do go spare with them sometimes I will admit.
    YNWA

    Target: Mortgage free by 58.
  • Heedtheadvice
    Heedtheadvice Posts: 2,801 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    Tee hee! Been there too. Good luck!
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 352.1K Banking & Borrowing
  • 253.5K Reduce Debt & Boost Income
  • 454.2K Spending & Discounts
  • 245.1K Work, Benefits & Business
  • 600.7K Mortgages, Homes & Bills
  • 177.4K Life & Family
  • 258.9K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.