# Average If Not Blank – Excel & Google Sheets

This tutorial will demonstrate how to calculate the average of a set of numbers while ignoring blank values or categories in Excel and Google Sheets. ## Ignore Blank Values with AVERAGE Function

The AVERAGE Function automatically ignores any cells that are blank or that contain text.

This example uses the AVERAGE Function to calculate the Average Score whilst ignoring the text value of the Score of Team B and the blank value of the Score of Team C: The AVERAGE Function uses only the numerical values associated with Teams A, D and E

## Treat Text Values as Zero with AVERAGEA Function

In order to treat text values as zero in the calculation, the AVERAGEA Function can be used. Blank cell values are ignored by this function.

This example uses the AVERAGEA Function to calculate the Average Score whilst ignoring the blank Score value of Team C and treating the text Score value of Team B as being 0: This example calculates the average of the values 4, 0, 5 and 3

## Ignore Blank Category Values Using AVERAGEIFS

This example uses the AVERAGEIFS Function to calculate the Average Score for teams with non-blank names and ignores Scores that are text values ## Ignore Blank Category Values – Array

If you don’t have access the AVERAGEIF function, you can use a nested AVERAGE and IF Function.

This example calculates the Average Score for teams with non-blank names and ignores any Scores that is a text value This formula uses the IF Function to evaluate whether the name of each Team is not blank, and only uses Scores from Teams with non-blank names in the AVERAGE Function. The score of 100 is ignored as the Team name is blank. The score of ‘No Data’ is ignored as it is not a numerical value.

In versions of Excel from 2019 and earlier, this formula is required to be entered as an array formula by pressing CTRL + SHIFT + ENTER. This is not required in later versions

This example can equally be calucated using an AVERAGEIFS Function as shown below

## Ignore Blank Category Values and Treat Text as 0

In order to treat text value Scores as 0, whilst still ignoring Teams with blank names, we can use a nested AVERAGEA and IF Function: This formula uses the IF Function to evaluate whether the name of each Team is not blank, and only uses Scores from Teams with non-blank names in the AVERAGEA Function. The score of 100 is ignored as the Team name is blank. The score of ‘No Data’ is treated as 0 by the AVERAGEA Function and so an average of 3.0 is calculated.

In versions of Excel from 2019 and earlier, this formula is required to be entered as an array formula by pressing CTRL + SHIFT + ENTER. This is not required in later versions

## Average If Not Blank in Google Sheets

Most of these formula examples work in the same way in Google Sheets as in Excel, but with some exceptions:

Whenever an IF Function is nested within another function and it references a cell range, Google Sheets needs to treat the formula as an array formula by using the ARRAYFORMULA Function: Unfortunately, the AVERAGEA Function works differently in Google Sheets as it does in Excel and so the example of =AVERAGEA(IF(B3:B7<>””,C3:C7)) cannot be used. This is because when the IF Function finds a blank value in the B3:B7 range, it produces a null value, but this is then counted as a 0 by the Google Sheets AVERAGEA Function, instead of ignoring this value as would be the case in Excel.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8529403,"math_prob":0.8875047,"size":3662,"snap":"2021-43-2021-49","text_gpt3_token_len":857,"char_repetition_ratio":0.16621104,"word_repetition_ratio":0.26530612,"special_character_ratio":0.22747132,"punctuation_ratio":0.07972028,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98244065,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],"im_url_duplicate_count":[null,1,null,3,null,3,null,3,null,3,null,3,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-26T12:03:29Z\",\"WARC-Record-ID\":\"<urn:uuid:0e039d61-1e34-428d-ac30-6af12f2ca926>\",\"Content-Length\":\"85437\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:36ad61ec-5eca-4e8b-9b36-49bf67e4e619>\",\"WARC-Concurrent-To\":\"<urn:uuid:10c724f9-5e96-4ee7-99d9-e3e010dd40ea>\",\"WARC-IP-Address\":\"172.66.43.120\",\"WARC-Target-URI\":\"https://www.automateexcel.com/formulas/average-if-not-blank/\",\"WARC-Payload-Digest\":\"sha1:FKMMEL5NCSIXUF4AZIED2CXCDTQYBNR4\",\"WARC-Block-Digest\":\"sha1:NTSTJKCJ5T6KBDBYQWV7QBAGVHVW5QGV\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323587877.85_warc_CC-MAIN-20211026103840-20211026133840-00579.warc.gz\"}"}