Google Spreadsheet Formula to Use Current Row in Function

whoadave picture whoadave · Jul 11, 2013 · Viewed 70.4k times · Source

I want to calculate the product of two different columns (e.g., A & B) for each row on my spreadsheet. For a single row, this would work by using =PRODUCT(A1:B1), but I can't figure out how to get the function to use the current row instead of a manually entered row. I know you can get a reference to the current row using ROW(), but I get an error when I try something like PRODUCT(AROW():BROW()).

Answer

AdamL picture AdamL · Jul 11, 2013

If you copy the formula you quoted into another row, or fill it down using Ctrl+D, it will automatically change the reference to the row you are copying/filling to. This is called a "relative reference". If you use the formula =PRODUCT($A$1:$B$1), this is called an "absolute reference", which will not change if copied elsewhere.

You can also use the following formula in any row:

=A:A*B:B

which will return the product of the two values in the row the formula is invoked.