Currently, I am attempting to retrieve the row number where the row meets certain criteria. However, I seem to be encountering an issue:
- Instead of getting the desired result, I am obtaining an array like this:
[,,2]
- Although I have attempted using
filter()
at the end, it has proven to be ineffective. Additionally, I am uncertain about its efficiency since I am already utilizing map to iterate through the data in order to obtain the row:
ar = ["ABC", 25];
vs = [["CBA", 14],
["ABC", 25],
["DRT", 34]]
function f101() {
const ss=SpreadsheetApp.getActive();
const sh=ss.getSheetByName('sheet name');
const rg=sh.getRange(1,1,sh.getLastRow(),sh.getLastRow());
const vs=rg.getValues();
let holder=vs.map((r,i)=>{if(r[0]==ar[0] && r[1] == ar[1]){return i;}});
}
Expected Outcome:
1 //2nd row
This is my attempt at modifying it based on this response