**=AVERAGEIF(B25:B29,"<>NA")**

**I understand that Excel Form is NOT Excel Spreadsheet. (****This works beautifully in Excel Spreadsheet.)**

**However, my customer would like this implemented in the Survey123 app that I'm developing.**

**How would I go about solving this issue?**

**Tags: ****survey123 numbers #survey123 #Excel form**

Hi George,

I assume that the value being averaged is in a repeat. This can be done with at least 1 hidden question, though possibly 2 are required depending on the form layout.

The first question needed is a calculate question to store whether this repeat should be calculated or not. This can be done with the following function:

if(${q} != "NA", 1, 0)This will store 0 if the value is NA, and 1 otherwise. A sum() function outside the repeat will then count the number of answers that are not NA

if the question with the values being stored is a select_one question, you can make the "NA" value 0 - a zero value will not impact the average calculation and you can then do sum(${q}/sum(${<COUNTING_QUESTION>). If the question is not a select_one, you would need to have a second calculate question to store the values that should be used in the average; it will need the following formula:

if(${q} != "NA", ${value_question}, 0)One thing to note in constructing these is to set the bind::type column to

intordecimal(depending on the value type) so that formulas treat them as numeric values (instead of text values).