Google Spreadsheet vlookup with arrayformula PLUS multiplication of returned value(s)

吃可爱长大的小学妹 提交于 2019-12-11 01:50:10

问题


I have my VLOOKUP with ArrayFormula working thanks to Adam's (AD:AM) brilliantly spelled-out solution (https://productforums.google.com/forum/#!searchin/docs/parallel$20lookup$20solution/docs/36A0epDlIdE/qnywZst0DioJ)

So in col J this is what I have:

=ArrayFormula(VLOOKUP(H2:H;ProductTable!A2:C;3*SIGN(ROW(H2:H));FALSE))

Works great. However, I would like to then take the returned value(s) from that formula in col J and multiply it against the Qty value(s) that are in row I.

Obviously I could add an extra helper column in col K...

=ARRAYFORMULA(I2:I*J2:J)

...but I was hoping to avoid adding yet another column to my Query results, especially since the returned results in col J have no visible purpose on the worksheet - they are meant to be used strictly for mathematical purposes only.

I've attempted multiple ways of slipping that formula into the ArrayFormula / VLOOKUP function in col J, but I've had no luck thus far.

Maybe it can't be done(?), or maybe I could just benefit from a fresh set of eyes looking at this issue.


回答1:


Never mind. I'm not sure why this didn't appear to work when I had tried it before, but out of desperation I just walked away for a while, and then just re-tried everything again. And this time I get the results that I was looking for:

=ArrayFormula(VLOOKUP(H2:H;Backend_Product!A2:C;3*SIGN( ROW(G2:G));FALSE )*I2:I)

(a bit of a DUH, so maybe I had originally referenced the wrong column or something)




回答2:


The post you referenced is from 2011. I think that use case has been resolved since then.

I have a column using the formula =ArrayFormula(VLOOKUP(J$2:J,$C$2:$D,2,FALSE)). I created a check column with =VLOOKUP(J2,$C$2:$D,2,FALSE) which I dragged down a number of rows.

It appears that, in the array formula, J is being iterated just as it is in my dragged formula, while C:D are fixed. Both the original column and check column have the same result data so far as I've dragged the check column down.

Caveat: I did not do an exhaustive search or create a particularly clever test case. I just eyeballed a good heaping of rows of actual data.



来源:https://stackoverflow.com/questions/22260953/google-spreadsheet-vlookup-with-arrayformula-plus-multiplication-of-returned-val

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!