Forum Discussion
lobo114
Sep 21, 2023Brass Contributor
Can't Average an Index Match function with "blank" cells
I have a table that contains user selected data validation drop downs for Probability and Severity. My formula assigns those selected words a number from another sheet using an Index Match function and then averages those numbers at the bottom of the table. My formula works fine until a user selects "N/A" from column B, which doesn't require them to then use the drop down in columns C or D which results in an #N/A error at the bottom of the columns. My formula that I am using for column C is: =AVERAGE(INDEX('Drop Down'!F2:F6,MATCH(C8:C32,'Drop Down'!E2:E6,0))). I'm guessing the reason that I am getting the error at the bottom of the column is that my current formula sees data in the blank C and D cells due to the data validation drop downs and can't complete the calculation. Is there a way I can alter my formula, so it ignores these "blank" cells when it calculates? My thought was to write the formula to say if there was an "N/A" in column B, don't include the column C cell in the average calculation. Any help would be greatly appreciated. Here is the link to my spreadsheet.
Thanks. Use these. In C33:
=AVERAGE(IFERROR(INDEX('Drop Down'!F2:F6,MATCH(C8:C32,'Drop Down'!E2:E6,0)),""))
In D33:
=AVERAGE(IFERROR(INDEX('Drop Down'!H2:H5,MATCH(D8:D32,'Drop Down'!G2:G5,0)),""))