ZLOOKUP
ZLOOKUP copied to clipboard
function not working
Hello ZLOOKUP friends,
I tried to implement the function but it does not work at all, the column where the returned values should appear remains empty. I checked the data already. It shouldn't be the case. I also tried to change the threshold and it does not change anything. I have ZLOOKUP, lev and my function in the same file. Please find a code snippet below. Is there something wrong in the implementation?
var lastMain = sheet.getLastRow();
var lastPlays = sheetPlays.getLastRow();
// create an array for the data to be looked up (C2 to last row of J column in plays)
var dataLookUpPlays = sheetPlays.getRange(2,3,lastPlays,8).getValues();
// create an array for the data to be searched for
var valuesToSearchPlays = sheet.getRange(2,3,lastMain,1).getValues();
// create an array for the data to be created (plays)
var playsData = sheet.getRange(2,8,lastMain,1).getValues();
// update cells in plays column with data from spreadsheet with plays
for (i=0;i<lastMain;++i){
playsData[i] = ZLOOKUP(valuesToSearchPlays,dataLookUpPlays,7,60);
sheet.getRange(i+2,8).setValue(playsData[i]);
}