使用函数作为数组公式来计算每一行的数据
该函数的作用是转置一组 id 行和一组变化的数量行。作为返回,具有数量的行与 id 一起返回,剩余的数组用于查询定价范围。最后,将所有 ID 及其各自数量的总价格相加。最终总价还要乘以 CT 中的相应行。
现在,我在 CW4:CW 列的每一行中都有该函数,因为我似乎无法获取 arrayformula 来计算我需要的数据。
电子表格(隐藏不必要的列和页面): https://docs.google.com/spreadsheets/d/1E5p0WPQg6F8ZlBDWpKrJKHoXIlfQOOYYs7491Mr-EIA/edit?usp=sharing
如果我的解释不是最好的,那么我很抱歉,现在已经晚了,我已经花了大量的时间停留在这个问题上。如果您需要说明或示例表,请随时发表评论。
功能:
=ARRAYFORMULA(IFERROR(IFNA(
QUERY(
{VLOOKUP(QUERY({SPLIT(TRANSPOSE(CX$3:EO$3 & " " & CX4:EO4), " ", 1, 0)}, "SELECT Col1 WHERE Col2 IS NOT NULL", 0), EP$4:ER, 3) *
QUERY({SPLIT(TRANSPOSE(CX$3:EO$3 & " " & CX4:EO4), " ", 1, 0)}, "SELECT Col2 WHERE Col2 IS NOT NULL", 0)},
"SELECT sum(Col1) LABEL sum(Col1) ''", 0) / CT4, ""), ""
))
引用我需要作为数组工作:
CX4:EO4
CT4
数据图片:
What the function does is transpose a set row of ids and a changing row of quantities. In return the rows that have a quantity are returned with the id and the remaining array is used to query a pricing range. Finally the total price is summed for all the id's and their respective quantities. Also the final total price is multiplied by the corresponding row in CT.
Right now I have the function in every row in column CW4:CW as I cannot seem to get the arrayformula to calculate the data how I need it.
Spreadsheet (Hid unnecessary columns and pages):
https://docs.google.com/spreadsheets/d/1E5p0WPQg6F8ZlBDWpKrJKHoXIlfQOOYYs7491Mr-EIA/edit?usp=sharing
Future apologies if my explanation isn't the greatest, it's late here and I've spent a deal of time stuck on the problem. Feel free to comment if you need clarification or an example sheet.
Function:
=ARRAYFORMULA(IFERROR(IFNA(
QUERY(
{VLOOKUP(QUERY({SPLIT(TRANSPOSE(CX$3:EO$3 & " " & CX4:EO4), " ", 1, 0)}, "SELECT Col1 WHERE Col2 IS NOT NULL", 0), EP$4:ER, 3) *
QUERY({SPLIT(TRANSPOSE(CX$3:EO$3 & " " & CX4:EO4), " ", 1, 0)}, "SELECT Col2 WHERE Col2 IS NOT NULL", 0)},
"SELECT sum(Col1) LABEL sum(Col1) ''", 0) / CT4, ""), ""
))
References I need to work as an array:
CX4:EO4
CT4
Pic of data:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
演示电子表格
或更短:
更短但速度较慢(不建议使用):
try:
demo spreadsheet
or shorter:
even more shorter but slow (not recommended to use):