# Average

Options
✭✭

I would be grateful if someone could tell me what to do.

I want to find the average of columns A and B on a sheet. If column A has data and column B does not, what formula should I use?

Options

Hi @Kenji

Thank you for clarifying! In this case, you can wrap an IFERROR Function around your formula. This says if there's an error (because there is no data), then return a blank cell:

=IFERROR(AVG([ColumnA]:[ColumnB]), "")

Cheers,

Genevieve

• ✭✭✭✭✭
Options

=AVG([ColumnA]:[ColumnB])

• ✭✭
Options

Hi,

Thank you very much for the answer.

I tried it and got #DIVIDE BY ZERO.

If Columns A and B have data, it will work, but my case is there is no data in Column B.

Options

Hi @Kenji

Would you be able to provide a screen capture of the columns you're referencing? If one column has numbers and the other is completely blank, you should still be able to see a number with the AVG formula provided above:

Do you have any formulas in these referenced columns? If so, is it possible that there's a #DIVIDE BY ZERO error in either ColumnA or ColumnB? If there's an error in one of those cells, it will appear in this other formula that's referencing it.

Cheers,

Genevieve

• ✭✭
Options

I am very sorry, but I misunderstood my sheet.

What I wanted to know was the case where there was no data in both Column A and Column B. In that case, I want to make sure that nothing is displayed in the Average cell.

Options

Hi @Kenji

Thank you for clarifying! In this case, you can wrap an IFERROR Function around your formula. This says if there's an error (because there is no data), then return a blank cell:

=IFERROR(AVG([ColumnA]:[ColumnB]), "")

Cheers,

Genevieve

• ✭✭
Options

Thank you very much for the great advice!

It works!

Best,

Kenji

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!