0

This might be closer to a math question with a stupidly easy answer, but I can't figure out the order of functions to use in my cells.

I am trying to find the sum of the absolute values of the differences between two columns of four rows each. A bit of a mouthful, but hopefully the formula I have explains it well enough. =SUM(ABS(A1-B1)+ABS(A2-B2)+ABS(A3-B3)+ABS(A4-B4)) This formula gives me the exact answer I am looking for.

The issue is that I will need to use this formula for hundreds of rows, meaning I would have to type out +ABS(Ax-Bx), x being the row number, hundreds of times. I don't want to do that. Is there a way I can rewrite the function (either mathematically or in terms of google sheets functions) so that I only have to input, say a range and avoid having to type out 100 ABS functions?

I would also accept some easy way to type out 100 copies of ABS(Ax-Bx) with an ascending x value so I can just copy and paste it into the function.

0

What you need is an array formula, which is designed for just this kind of problem. It lets you apply a formula to every row in a range. There are lots of tutorials online, but here’s a link to the official documentation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.