带条件数组的 Sumif
我很惊讶我在任何地方都找不到这个,这让我觉得我一定是错误地处理了这个问题。我希望能够在 sumifs 中包含一系列值,以便它对条件中的每个值执行类似循环的操作(无需为每个值编写“ +sumifs(....)”。这是我的示例到目前为止还不起作用
`=SUMIFS(Sum,Range1,Criteria1, '[Stores.xlsx]Sheet1'!$H:$H, "Store #"&Regions!$T:$T&"*")`
所以我试图传递 Regions!T:T 中的每个值作为标准。
例如,“Store #150 Los Angeles”和“Store #155 San Diego”都需要通过参数传递。目前,该公式仅返回匹配的第一个项目,不会继续到下一个项目。
我希望这是有道理的。请询问您是否需要更清晰的信息。
I'm surprised I can't find this anywhere which makes me think I must be going about this incorrectly. I want to be able to include a series of values within sumifs so it performs like a loop for each value in the conditional (without having to write a " +sumifs(....) for each value. Here's an example of what I have so far that is not working
`=SUMIFS(Sum,Range1,Criteria1, '[Stores.xlsx]Sheet1'!$H:$H, "Store #"&Regions!$T:$T&"*")`
So I'm trying to pass every value in Regions!T:T as a criteria.
For example "Store #150 Los Angeles" and "Store #155 San Diego" would both need to be passed through the argument. Currently the formula just returns the first item it matches and doesn't continue to the next item.
I hope that makes sense. Please ask if you need more clarity.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为最简单的方法是在 T 列旁边启动一个“中间”列,对该列的每一行执行 sumifs,然后将该列求和到另一个单元格中。表格甚至数组总和在这里也可能有帮助。
我在 VBA 中提出了以下内容,但我无法完全测试它:
同样,我确信有一种方法可以使用公式进行循环,但四处搜索,这对我来说并不明显。
I think the easiest is to start an "intermediate" column next to the T column, do a
sumifs
for each of the rows of that column, and then sum that column into another cell. Tables or even just array sums may also be helpful here.I came up with the following in VBA, but I cannot test it completely:
Again, I'm certain there's a way to do this looping with the formula, but searching around, it was not evident to me.