admin管理员组文章数量:1357098
I have a Sheet which basically adds name and address info from a membership list to a list of bank payments.
LINK TO EXAMPLE SHEET
It uses an Xlookup (in Column G) to compare the Bank Account Name (Column B) with the list of Bank Account Names on the membership sheet (Gift Aid List). If it finds a match it uses ImportRange to import columns C thru F from the membership list. If it can't find anything it writes "No GA"
=XLOOKUP(B4:B, IMPORTRANGE($G$2, "Gift Aid List!H:H"), IMPORTRANGE($G$2, "Gift Aid List!C:F"),"No GA",0)
This works well, but I want to use an Arrayformula to copy this down the column (rather than doing it manually - the bank data is actually another Importrange, so I want the formula to automatically expand down the column as more data is added.)
I tried this:
=ArrayFormula(XLOOKUP(B4:B, IMPORTRANGE($G$2, "Gift Aid List!H:H"), IMPORTRANGE($G$2, "Gift Aid List!C:F"),"No GA",0))
which works, except it only seems to bring the first column (C) of data from the Gift Aid List and not the others.
I realised that, in this example, the Importranges are not required, but in the real world the Gift Aid List info is in a separate Sheet. Anyway, I tried taking them out, but it still only imports the first column of data.
So I'm thinking it might be something to do with the XLOOKUP, but before I start trying to find a workaround for that I thought I'd ask on here.
(The obvious workaround, I realise, would be to just have a separate copy of the formula in each column and just bring one column of data at a time, but that's not as elegant)
Any ideas why this is or how I can fix it?
The sample sheet linked has four tabs:
- with the non-arrayed formula,
- with the arrayed formula,
- with the arrayed formula with the Importrange removed
- the GIFTAIDLIST data to be imported. (This would normally be in a separate spreadsheet)
Many Thanks in advance Tom
I have a Sheet which basically adds name and address info from a membership list to a list of bank payments.
LINK TO EXAMPLE SHEET
It uses an Xlookup (in Column G) to compare the Bank Account Name (Column B) with the list of Bank Account Names on the membership sheet (Gift Aid List). If it finds a match it uses ImportRange to import columns C thru F from the membership list. If it can't find anything it writes "No GA"
=XLOOKUP(B4:B, IMPORTRANGE($G$2, "Gift Aid List!H:H"), IMPORTRANGE($G$2, "Gift Aid List!C:F"),"No GA",0)
This works well, but I want to use an Arrayformula to copy this down the column (rather than doing it manually - the bank data is actually another Importrange, so I want the formula to automatically expand down the column as more data is added.)
I tried this:
=ArrayFormula(XLOOKUP(B4:B, IMPORTRANGE($G$2, "Gift Aid List!H:H"), IMPORTRANGE($G$2, "Gift Aid List!C:F"),"No GA",0))
which works, except it only seems to bring the first column (C) of data from the Gift Aid List and not the others.
I realised that, in this example, the Importranges are not required, but in the real world the Gift Aid List info is in a separate Sheet. Anyway, I tried taking them out, but it still only imports the first column of data.
So I'm thinking it might be something to do with the XLOOKUP, but before I start trying to find a workaround for that I thought I'd ask on here.
(The obvious workaround, I realise, would be to just have a separate copy of the formula in each column and just bring one column of data at a time, but that's not as elegant)
Any ideas why this is or how I can fix it?
The sample sheet linked has four tabs:
- with the non-arrayed formula,
- with the arrayed formula,
- with the arrayed formula with the Importrange removed
- the GIFTAIDLIST data to be imported. (This would normally be in a separate spreadsheet)
Many Thanks in advance Tom
Share Improve this question asked Mar 28 at 18:06 Tom AlbuTom Albu 134 bronze badges1 Answer
Reset to default 1Use map/lambda
in place of arrayformula
to populate all target columns:
=map(B4:B,lambda(Σ,if(Σ="",,xlookup(Σ,importrange(G2,"GiftAidList!H:H"),importrange(G2,"GiftAidList!C:F"),"No GA"))))
本文标签: Google SheetsArray Formula with Xlookup and ImportrangeStack Overflow
版权声明:本文标题:Google Sheets - Array Formula with Xlookup and Importrange - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744020213a2577059.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论