excel min of a subset of a range

拥有回忆 提交于 2019-12-06 14:18:07

问题


I have an excel sheet with two columns of interest Year and Donations. The year values are 2008,2009,2010 etc...

I would like to get the minimum of all donations for 2009. I have tried

MIN(IF(Year="2009",Donations,"")

The problem with this is for years other than 2009 it falls to "" and hence the min is 0.

Is there a different function I should be using.


回答1:


The formula you have is correct. MIN will ignore text. A couple of things to check:

Make sure the data in Years is really text. If it's a number, you need to remove the quotes around 2009 or it won't find anything.

Make sure you're entering the formula with Control+Shift+Enter, and not just Enter. Excel will put curly braces around the formula in the formula bar indicating it's an array formula.

Make sure you're not actually getting the correct answer. That is, make sure there are no entries of zero for 2009. Seems unlikely you would record a donation of zero, but it's worth a look.

If your Year data is actually text, maybe because it's imported, then it's possible the Donations data is text too. If that's the case use

MIN(IF(Year="2009",Donations*1,""))

The *1 will force the text to a number if possible.




回答2:


Enter this as an array formula (press ctrl-shift-enter rather than just enter to make it an array)

=MIN(IF(<YearRange>=2009,<ValueRange>,""))



回答3:


Create a pivot table with Year as a row and Donations as Data (choose the Minimum option).



来源:https://stackoverflow.com/questions/5134005/excel-min-of-a-subset-of-a-range

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