Formula to calculate percentage of cells with 'X' in Numbers for Mac

In Numbers on a Mac, help me write a formula that shows the percentage of cells in a column that contain an X and the number of cells in the column is 16 please.

HomePod, 27

Posted on Oct 11, 2026 11:46 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 12, 2026 9:33 AM

The parentheses are wrong but it's not really your fault as Numbers will "help" you by introducing its own parentheses when you select a function. (They are the little "crescent" icons you see at the end of your formula above.)


So, let's simplify the formula entry by just specifying the COUNTIF function. In the cell, start typing =COUNTIF. Numbers will then show you this:



Click the green COUNTIF suggestion in green to see this:



Click "test-array" and then select the cells E2 to E17 (my example uses A2 to A17 but it is absolutely the same):



Click "condition" and type "=X", including the quotes:



Press the return key to validate the formula:



In my example, 3 rows contain the value "X", so the function return value is 3, which is displayed as 300%.


If everything looks good, double click the cell (to enter edit mode), type "/COUNT" (without the quotes) and select COUNTA in the suggestion list:



You should see:



Click "value" and select the cells E2 to E17 (my example still uses A2 to A17), you can also type "E2:17" (without the quotes) as selecting the cells can be tricky at this point:



Press the return key to validate the formula:


39 replies
Question marked as Top-ranking reply

Oct 12, 2026 9:33 AM in response to StephenfromAlbuquerque

The parentheses are wrong but it's not really your fault as Numbers will "help" you by introducing its own parentheses when you select a function. (They are the little "crescent" icons you see at the end of your formula above.)


So, let's simplify the formula entry by just specifying the COUNTIF function. In the cell, start typing =COUNTIF. Numbers will then show you this:



Click the green COUNTIF suggestion in green to see this:



Click "test-array" and then select the cells E2 to E17 (my example uses A2 to A17 but it is absolutely the same):



Click "condition" and type "=X", including the quotes:



Press the return key to validate the formula:



In my example, 3 rows contain the value "X", so the function return value is 3, which is displayed as 300%.


If everything looks good, double click the cell (to enter edit mode), type "/COUNT" (without the quotes) and select COUNTA in the suggestion list:



You should see:



Click "value" and select the cells E2 to E17 (my example still uses A2 to A17), you can also type "E2:17" (without the quotes) as selecting the cells can be tricky at this point:



Press the return key to validate the formula:


Oct 11, 2026 6:16 PM in response to StephenfromAlbuquerque

Not a problem.


If you type the formula yourself, clear the cell and type this:

=COUNTIF(E2:E17,"=X")/COUNTA(E2:E17)


Note the quotes around =X, i.e. "=X". You also missed the COUNTA() function. You could replace the COUNTA() function by the value 16 if you are sure the number of cells will never change, e.g.:

=COUNTIF(E2:E17,"=X")/16


Finally, in this particular case, there is no need to surround the whole calculation with parentheses.


I hope this helps.

Oct 11, 2026 7:18 PM in response to 6x6

E is the X voted column and there is 16 lines for the street name Barrinson begging on E2. The answer is put in the far right column I at line 17. Not shown is column A. I have used by typing =COUNTIF(E2:E17,"X")/COUNTA(E2:E17) AND GET A SYNTAX ERROR which I am unable to determine the error. I17 is formatted for percentage.


I'm struggling and don't know why. If I don't respond it's because it is late here and will pick the back up tomorrow.

I really appreciate your patience.

Oct 12, 2026 10:55 AM in response to StephenfromAlbuquerque

I think I know why: the COUNTA function only counts the cells containing a value. I see in your previous screenshots that the spreadsheet contains blank cells.


Replace the COUNTA function with the ROWS function. The ROWS function returns the numbers of rows regardless of the content of the range.


Here is the same example, this time using the ROWS function, with some cell values cleared:


Oct 12, 2026 1:44 PM in response to 6x6

Now, a new question please. I attempted to use the same formula, just changing the cell numbers, for a street called Borg, see attachment. I do not get a number of 300, nothing at all, for the three X'd boxes in row E. The formula is stopped where I should have a percentage of 300 shown before correcting to ROWS.


And, would it be possible to copy the formula from a working cell, paste it where I want it and correct the cell numbers into the new location?


Oct 12, 2026 2:15 PM in response to StephenfromAlbuquerque

Yes, copying the cell (just copy the cell itself – not the formula inside the cell – just like you would copy a cell value) where the formula works and pasting it to a new cell (for "Borg", for instance) would be the way to go.


After pasting the cell, double-click the cell to enter edit mode (you will see that the cell references have changed), click on the cell reference in the COUNTIF function and select the appropriate cells. Do the same for the ROWS function.


There is a more advanced way of counting cells using multiple criteria (using the COUNTIFS function – plural – instead of the COUNTIF function – singular) but if your spreadsheet is rather static when it comes to the streets, it would make things more complicated at this time.


Looking at your data, you may want to consider using a separate table to summarize your data. It would make things clearer as you wouldn't have to scroll down as much to see the percentages. This is also where the COUNTIFS (plural) function really shines. I could show you an example if you are interested.

Oct 13, 2026 10:30 AM in response to 6x6

Good example and I will be back with you to dive into the tables. This spreadsheet I am working with is active right now in a voting process of an HOA until the 22nd. I developed it to aid with paper count ballots that are handed in over a 30 day period. Your stamina is exemplary, many with knowledge would have flipped me off over my lack of understanding. I now understand more than the day I asked the question.

Oct 16, 2026 1:31 PM in response to 6x6

Good afternoon 6X6, I have caught up my 680 line spreadsheet and if you are still interested, I would love to use a table and I know hardly anything about them. There are 15 street names that we use and we are wanting to see the percentage of voters from each street. All of the percentage formulas are in place and functioning correctly. This spreadsheet, when printed horizontally, is about 15 pages long.

Oct 17, 2026 5:19 PM in response to StephenfromAlbuquerque

Hello Stephen,


I'd be glad to help. I guess the most important thing to know is that, as opposed to Microsoft Excel, you can have multiple tables in the same sheet (e.g. Sheet 1, which is the default sheet if you don't rename it) in Numbers. Also the terminology is important: the "spreadsheet" is the Numbers document/file, a "sheet" is a page within a spreadsheet, and a "table" is a table where you enter or calculate data. A spreadsheet can contains multiple sheets and a sheet can contain multiple tables (see below). (You can also add other elements such as charts.)


In your case, I suspect that you only have one spreadsheet, with a single sheet that contains a single table.


Here is the example I was referring to earlier, this time showing the sheet numbers at the top:



As you can see, I have 5 sheets in this spreadsheet: Sheet 1 thought Sheet 5. Sheet 5 is the one I showed you before. (The other sheets contain unrelated data; I use this spreadsheet as a scratch pad.)


Your current sheet probably only have one table but you could add other tables to the same sheet. Having multiple tables in the same sheet is convenient if you can see all of them at a glance. It becomes less so if a table contains a large number of columns, as your spreadsheet seemed to indicate. In that case, you have to scroll horizontally to see the other tables. Similarly, if your table has a lot of rows, especially for the raw data table (as opposed to the summary table that would contain summarized data, such as the percentages), you have to scroll a lot to enter the raw data and you have to scroll back up to see the summary table (you can also add tables beneath other tables; the position of the tables is not predefined; you can move them around at your convenience).


In light of the number of printed pages and the fact that you have a large number of rows and columns, I would recommend adding a sheet to summarize the data from the "main" sheet (the raw data sheet where you record your data). This way you could choose to print either the raw data sheet or the summary sheet, depending on the need.


Would you like to pursue the first option (multiple tables in the same sheet) or the second option (multiple sheets)?

Formula to calculate percentage of cells with 'X' in Numbers for Mac

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.