You'll want to use Range.getValues()
.
The following function takes a range A2:B4
, and returns its pure values:
function getRangeValues() {
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("A2:B4");
var values = range.getValues();
return values;
};
To use the script, you must first install it: In your spreadsheet, click Tools -> Script editor, and paste the script. From the drop-down menu in the Script Editor Toolbar, select getRangeValues, and click the Run button (you only need to do this once).
This will give you an authorization dialog, in which you must accept. From now on, you can use the function by entering =getRangeValues()
in a cell.
See the example spreadsheet I have set up, and copy it to your own drive if you want to experiment with it.