未找到应用程序脚本 vlookup? [英] apps script vlookup not found?
问题描述
我重新排列了一些列,现在我的代码不起作用.我正在尝试使用 vlookup 从另一个表中获取值.
I rearranged some columns and now my code isn't working. I'm trying to use vlookup to get values from another table.
var name = ss.getRange('G'+lastRow);
name.setValue('=VLOOKUP("Form Responses_Images/"&B'+lastRow+',importrange("https://docs.google.com/spreadsheets/d/###","Form Responses!Q:AA"),8,false)');
SpreadsheetApp.flush();
name.copyTo(name,{contentsOnly:true});
我需要填写的表格:
我用来查找信息的表格:
The table that I am using to look up info:
现在,当我运行脚本时,该单元格吓坏了并给出了错误:错误在 VLOOKUP 评估中未找到值 'Form Responses_Images/20ba4a5c.Upload.040416.jpg'.
Right now when I run the script, the cell just freaks out and gives the error: Error Did not find value 'Form Responses_Images/20ba4a5c.Upload.040416.jpg' in VLOOKUP evaluation.
但是正如您所看到的,两个表中的值都是 Form Responses_Images/20ba4a5c.Upload.040416.jpg
?
But as you can see both tables have the value Form Responses_Images/20ba4a5c.Upload.040416.jpg
in it?
推荐答案
您需要修复 importrange
函数和列索引.从 V
列开始,然后得到 3
rd 列.
You need to fix the importrange
function and the column index. Start from column V
and get the 3
rd column after that.
替换:
name.setValue('=VLOOKUP("Form Responses_Images/"&B'+lastRow+',importrange("https://docs.google.com/spreadsheets/d/###","Form Responses!Q:AA"),8,false)');
与:
name.setValue('=VLOOKUP("Form Responses_Images/"&B'+lastRow+',importrange("https://docs.google.com/spreadsheets/d/###","Form Responses!V:AA"),3,false)');
这篇关于未找到应用程序脚本 vlookup?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!