Google Sheets – How to Divide One Column by Another

google sheets

I am rather new to spreadsheets, and I feel like what I want to accomplish is rather simple, but I am having enormous difficulty finding anyone else doing something similar.

I have values in column A and B, and I want to divide A2 by B2, A3 by B3, etc. and output to column C. Putting this in C2 DOES work:

=ARRAYFORMULA(A2:A/B2:B)

But the rest of column C all the way down displays #DIV/0!. A little research uncovered the IFERROR function. Perfect! So I tried:

=IFERROR(ARRAYFORMULA(A2:A/B2:B))

But this does not change the output. Still #DIV/0! all the way home. Am I using IFERROR wrong? Is there a way to select on the cells that have values? Is there another solution?

Best Answer

Use this formula instead.

Formula

=ARRAYFORMULA(IFERROR(A2:A/B2:B))

Note

Error catching has to take place inside the ARRAYFORMULA