moderated Re: Excel Formula
Richard Turner
I’m not sure why Russell’s instructions didn’t work for me, but I did the following and it worked. In b101: =COUNTIF(B2:B100,"Yes") IN b102, =COUNTA(B2:B100) In b103, =B101/B102
To test this, I put a Yes in b2 and No in b100. I got 1 as the result of yes’s, 2 in the result for number of cells with data in b102, and .50 in b103 which then switching the number type to percent, got 50.00. I did not bother changing the decimal places from the default.
HTH, Richard
Check out my web site at: www.turner42.com “The Hitch Hiker's Guide to the Galaxy has this to say on the subject of flying. There is an art, it says, or rather, a knack to flying. The knack lies in learning how to throw yourself at the ground and miss." Douglas Adams, from Life, The Universe and Everything, p.59
From: main@jfw.groups.io <main@jfw.groups.io> On Behalf Of
Russell Solowoniuk
Sent: Wednesday, June 26, 2019 7:53 AM To: main@jfw.groups.io Subject: Re: Excel Formula
Hi Steve,
Let’s say you have Yes or no in cells B2 to B100. In cell B101, or wherever you wish, type the formula, CountIf(B2:B100,”Yes”). This will give you the number of cells with “Yes” in them. Then, in B102, or whoever you wish, type the formula, =CountA(B2:B100) Note the letter “A” after “Count” in the above formula. This will give you the total number of cells in column B that have data. Now, to calculate the percentage of cells with “Yes” in them, in cell B103, or wherever, type the formula, =B101/B102 You are dividing the number of “Yes” by the total number of cells with data. You will get a number like 0.67 or something like that. Press CTRL + 1 while in that cell and change the number formatting to Percentage, choose the number of decimal places you wish to show, and tab to OK.
Hope this helps.
Russell

