简体   繁体   English

如何在Excel中使用通用运算符

[英]How to Use General Operators in Excel

I do not know how to ask it right 我不知道怎么问对

I use a formula to summarize values within a certain range 我使用公式来总结一定范围内的值

And I have two questions 我有两个问题

F1 contains the value I want to summarize, if I write "*", it summarizes everything, but without empty cells F1包含我要汇总的值,如果我写“ *”,则它汇总所有内容,但没有空单元格

"E" contains the first-last date to summarize, what the parameter to summarize all dates? “ E”包含要汇总的最后一个日期,要汇总所有日期的参数是什么? (* Does not work) (*不起作用)

That's my formula 那是我的配方

=SUMIFS(B1:B8,A1:A8,">="&E1,A1:A8,"<="&E2,c1:c8,F1)

explanation: "A" contains the dates, "B" contains the amounts, "C" contains the values, "E" contains the first-last date in summary 说明:“ A”包含日期,“ B”包含金额,“ C”包含值,“ E”包含摘要中的倒数第二个日期

Sometimes I want to summarize everything regardless of the date, value of the cell 有时我想总结所有内容,而不考虑单元格的日期和值

I have other parameters that are not related here 我还有其他与此无关的参数

If it is not clear, respond to me 如果不清楚,请回复我

在此处输入图片说明

In this case you should use SUMPRODUCT , so you can just eliminate any of your criteria using IF 's inside. 在这种情况下,您应该使用SUMPRODUCT ,因此您可以使用IF内部消除任何条件。

For example: 例如:

=SUMPRODUCT(B2:B8*(IF(ISNUMBER(E2)=TRUE,A2:A8>=E2,1))*(IF(ISNUMBER(E3)=TRUE,A2:A8<=E3,1))*(C2:C8=D1))

You can make the IF 's you want. 您可以根据需要创建IF I've used ISNUMBER but you can just make a list validation and insert a "All Dates" and pass this to the IF test. 我使用过ISNUMBER但是您可以进行列表验证并插入“所有日期”,然后将其传递给IF测试。 Remember to close with ctrl+shift+enter. 请记住使用ctrl + shift + enter关闭。

EDIT: as now I have some of your data and now can understand better you request, I have adapted the formula to work as you need. 编辑:由于现在我有一些数据,现在可以更好地理解您的要求,因此我对公式进行了调整,以根据需要进行工作。 Wrapped both IF 's in one, which will check if F1 has "*" in it's value. 将两个IF包裹在一起,这将检查F1的值是否带有“ *”。

=SUMPRODUCT((B2:B8)*(IF(F1="*",1,(A2:A8>=E1)*(A2:A8<=E2)*(C2:C8=F1))))

EDIT: forgot parentheses inside the if 编辑:忘记括号内如果

newer EDIT: adapted the formula to what I think OverflowStack is trying to tell me (sorry people, my english understanding is not that good...), now if F1 is a value contained in the C column, it will return that sum summarized between dates, if the value is "*" it will return the total count. 较新的编辑:将该公式调整为我认为OverflowStack试图告诉我的内容(对不起,我的英语理解不是那么好...),现在如果F1是C列中包含的值,它将返回该总和在日期之间,如果值是“ *”,它将返回总数。

If it's still not what OP needs, I could probably do better if I can access a dummy sheet of his data on Excel Online, with his variables and desired output example. 如果仍然不是OP所需要的,那么如果我可以在Excel Online上访问他的数据的虚拟工作表以及他的变量和所需的输出示例,则可能会做得更好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM