I’m working on a Google Sheets assignment and stuck on calculating what percentage of items in my dataset are marked as discontinued. I need to create a formula that shows this as a proportion.
My approach so far has been to use COUNTIF to count all the zeros in column J (which indicates discontinued status): =COUNTIF(J2:J78,"0"). This gives me the total number of discontinued items.
However, I’m not sure how to turn this into a proper proportion or percentage. Do I need to divide this count by the total number of rows? And if so, what’s the best way to structure this formula in Google Sheets?
Any help with the correct formula structure would be really appreciated. Thanks in advance!
Here’s another way to handle it with one formula: =COUNTIF(J2:J78,"0")/COUNT(J2:J78)*100. I use COUNT instead of COUNTA because it only grabs cells with actual numbers - handy if you’ve got headers or empty cells mixed in. You’ll get the percentage straight up without formatting the cell. This works great when your data’s all over the place or you need that raw percentage for other calculations. Just double-check your discontinued items are stored as the number 0, not text “0” - that’ll mess up your results.
You’re on the right track with COUNTIF. Here’s a cleaner way: use =COUNTIF(J2:J78,"0")/ROWS(J2:J78) and format the cell as percentage from the toolbar. I like ROWS better than COUNTA since it counts the actual range size even with empty cells - usually more accurate. Google Sheets handles the percentage conversion automatically, so no need to multiply by 100 or mess with decimals.
yep, you got it! try using =COUNTIF(J2:J78,"0")/COUNTA(J2:J78) to get the fraction. if you want a % just multiply that result by 100. COUNTA works great for your need as it counts only non-empty stuff.