I have a spreadsheet which has 3 different sheets each containing a column marked A column "Price (buy)" and B column "Price (sell)".
I want to calculate the "Price (sell)" column with a function but I can't find a way to expand it to new rows being added.
I have tried with ArrayFormula but can't get it to send a new row to the function and it simply returns the same result each time. Below is one of the ArrayFormula I've tried.
=ArrayFormula(iferror(if(A:A="";;if(row(B:B)=1;"Price (sell)";if(isblank(A:A)=False;sell_price($A2))))))
But this only returns 20 on each row regardless of the price in column A.
Example on how it should work:
- Make a new row.
- Enter price in the "Price (buy)" cell, let's say 10.
- The function (below) would automatically process and the answer would be placed in the "Price (sell)" column on the same row.
- "Price (sell)" should show 20.
The function would be different so this is just for the sake of example.
function sell_price(price) {
return price + 10;
}
Is there a way to make this work on all 3 different sheets and automatically expand to new rows being added in any of the 3 sheets? The information would come from a script via the API if that makes any difference.