• Wednesday , 3 June 2020

Match Function with Google Sheets Apps Script -JavaScript IndexOf Method Tutorial – Part 16

Code Canyon

Learn how to create Google Sheets Match function alternative using JavaScript in Apps Script.

Original source

3d Ocean

Related Posts


  1. Rashid Anwar
    May 15, 2019 at 05:53

    You are doing a great job. Keep it up and thank you.

  2. David Marcadet
    May 15, 2019 at 05:53

    Great vidéo, thank you so much!

  3. Daniel Ramel
    May 15, 2019 at 05:53

    Hi! In the 11:00 minute the log returns the value 0.0.
    I can understand that why the lookupRangeValues.indexOf(lookupValue) returns something like false ( in this case 0.0), but than you add 1 to it , so why isn't it returns 1.0?
    Could you help me with that? Thank you for your answer in advance.

  4. rockster rakesh
    May 15, 2019 at 05:53

    thankz for this great video bro….

  5. JesucristoNuestroSalvador
    May 15, 2019 at 05:53

    how can I execute script with a key like the enter ? Excelent … God Bless You.

  6. Carlos Wild
    May 15, 2019 at 05:53

    Question, I want to use the same idea but instead of search in what column, I need what row. the problem is that the values are arrays inside of singles arrays. I want to find the name: "John" and the …getRange(2, 2, lr, 1).getValues(); –> is [ [Carlos], [Mike], [John], [Tom]… ]

    I do not know why when we look by columns the values are simple as an array inside of and array, any tricks?

    for now I a using Match function in the sheet and then I get the value to the scrip.


  7. Computer Geeks
    May 15, 2019 at 05:53

    The log says "Undefined". Can you help me what's wrong with my script, @Learn Google Spreadsheets?
    As note: I have "Sheet1" and "Sheet2", and the column "Alfa", "Beta", Gamma".

    Here is my script:

    function myFunction(){
    var index = ColumnIndex("Sheet1","Beta");

    function ColumnIndex(sheetname,columnlabel){
    var activeSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetname);
    var lastColumnIndex = activeSheet.getLastColumn();
    var headers = activeSheet.getRange(1, 1, 1, lastColumnIndex).getValues()[0];
    var columnIndex = headers.indexOf(columnlabel)+1;

  8. Vivek Martin
    May 15, 2019 at 05:53

    Nice one! Thanks! Wondering if I can make this work with data in a single column and match values on multiple rows?

  9. abhishek singh
    May 15, 2019 at 05:53

    Hi LCS, Thanks for this video. Can you please help me out with an issue I am facing? My range is a single column. when i am cheking the logs, I am getting only the 1st element of the column.

    var arr2 = ss.getRange(2,1,r-1,1).getValues()[0];

    result = [Dog] (complete contents of the column -> Dog, Cat, Deer, Mouse, Dog)


  10. Laza Lazarevic
    May 15, 2019 at 05:53

    Welcome back 🙂 and thanx for another great video

Leave A Comment

You must be logged in to post a comment.