I do have simple custom function margin()
in Google Sheet (using Apps Script), which takes a value from cell H55 in the sheet named "Exchange Rates" and simply returns the same value that is in the cell.
function margin()
{
var price = 0;
price = SpreadsheetApp.getActiveSpreadsheet().getRange("Exchange Rates!H55").getValue();
return price;
};
If I put =margin() to any cell (eg. H56) - it works. But when I update the value in cell H55, say... from the number 1,05 to 1,55 - nothing happens to the value of cell H56. (Where the formula equals margin()
function).
When I put the formula =margin()
in any cell it calculates correctly the first time, returning 1,55. (Again - when I change the value of cell H55 to another number, the cells where my formula is are not updated).
Please, do I have to somehow run the script again? Or what can I do? (I simply tried to refresh the page, but nothing happened and I definitely don´t want to rewrite every cell with my function.) Thank you!