Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Google Sheets: Create Average of Numbers ONLY

Test Mark Percent
B4 Test 27/42 64%
B5 Test #DIV/0!

(Google Sheet Here, The Sheet in Question: Results)

In order to get this 64%, I have used this formula: =LEFT(D6,2)/RIGHT(D6,2) and this continues in each cell, the D6 value changing accordingly.
I have made conditional formatting so that where the cell contains #DIV/0!, it changes text colour to the same as the background, as you can see if you highlight the cells.

However, I am trying to find an average out of the percentages, but it comes up with the #DIV/0! error as it is averaging all cells, not just the number ones. How could I get it to create an average for just the percentages in each column.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

instead of:

=LEFT(D6,2)/RIGHT(D6,2)

use:

=IFERROR(QUERY(QUERY(, "select "&D6), "offset 1", ))

and to get average you can do:

=INDEX(AVERAGE(IFERROR(INDEX(SPLIT(D6:D, "/"),,1)/
                       INDEX(SPLIT(D6:D, "/"),,2))))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading