How do you calculate an average on a column that also contains "#Invalid Data Type" in some cells??

I have a column of numbers (days duration) between two date columns but, in many cases, one of the dates may be missing which gives me an #Invalid Data Type entry in the column where I am averaging the days duration. Attempting to average the column, I don't know the syntax to skip over the #Invalid Data Type cells to only average the cell that contain numbers.

I've tried this approach but it doesn't seem to be working as I get a "#UNPARSEABLE" response to the formula.

=if([Total - Appl Compl to Bus Ready] >=0, AVG([Total - Appl Compl to Bus Ready]:[Total - Appl Compl to Bus Ready], "")

Tags:

Best Answer

Answers

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    You will need to use an IFERROR statement to get rid of that error from the original source data.

    =IFERROR(original_formula, "")

  • GMichal
    GMichal ✭✭✭✭
    edited 04/21/23

    Thank you so much. I still have some type of context error as it is removing the #INVALID DATA TYPE entries as desired but it is also now clearing valid data out of the cells that have a duration in them.

    Original Formula

    =IF(NETWORKDAYS([Appl Compl Date]@row, [Business Ready Date]@row) >= 0, NETWORKDAYS([Appl Compl Date]@row, [Business Ready Date]@row) - 1, "")

    Updated Formula

    =IFERROR(=IF(NETWORKDAYS([Appl Compl Date]@row, [Business Ready Date]@row) >= 0, NETWORKDAYS([Appl Compl Date]@row, [Business Ready Date]@row) - 1, ""), "")

    What am I missing?

  • GMichal
    GMichal ✭✭✭✭

    Thank you so much. I still have some type of context error as it is removing the #INVALID DATA TYPE entries as desired but it is also now clearing valid data out of the cells that have a duration in them.

    Original Formula

    =IF(NETWORKDAYS([Appl Compl Date]@row, [Business Ready Date]@row) >= 0, NETWORKDAYS([Appl Compl Date]@row, [Business Ready Date]@row) - 1, "")

    Updated Formula

    =IFERROR(=IF(NETWORKDAYS([Appl Compl Date]@row, [Business Ready Date]@row) >= 0, NETWORKDAYS([Appl Compl Date]@row, [Business Ready Date]@row) - 1, ""), "")

    What am I missing?

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!