跳到主要内容

如何根据Excel中的条件查找最大值或最小值?

文档查找最大值 with-criteria-1

假设我具有以下数据范围,A列包含产品名称,B列包含订单数量,现在,我想查找产品KTE的最大订单价值,如以下屏幕截图所示。 在Excel中,我们如何根据一个或多个条件提取最大值或最小值?

仅根据一个条件找到最大值或最小值

根据多个条件找到最大值或最小值


箭头蓝色右气泡 仅根据一个条件找到最大值或最小值

要使用一个条件返回最大值或最小值,请使用MAX函数。

1。 输入以下公式: =MAX((A2:A13=D2)*B2:B13) 放入所需的特定单元格,请参见屏幕截图:

文档查找最大值 with-criteria-2

Tips:在此公式中: A2:A13 i包含条件的范围单元格, D2 是您要根据其找到最大值的标准, B2:B13 是返回相应值的范围。

2。 然后按 Ctrl + Shift + Enter 键一起获得KTE的最大值,请参见屏幕截图:

文档查找最大值 with-criteria-3

备注:要根据特定标准获得最小值,请输入此公式 =MIN(IF(A2:A13=D2,B2:B13)),输入公式后,必须按 Ctrl + Shift + Enter 键,那么您将得到以下结果:

文档查找最大值 with-criteria-4


箭头蓝色右气泡 根据多个条件找到最大值或最小值

如果要使用多个条件查找最大值或最小值,则可以使用以下公式:

以以下数据为例,我需要在一月份找到KTE的最大或最小顺序:

文档查找最大值 with-criteria-5

1。 在要放置结果的单元格中输入此公式: =MAX(IF(A2:A13=F1,IF(B2:B13=F2,C2:C13))),请参见屏幕截图:

文档查找最大值 with-criteria-7

Tips:在此公式中: A2:A13 是包含条件1的数据, B2:B13 是包含条件2的数据范围, F1F2 是您基于的标准, C2:C13 指您要返回最大值的范围。

2。 然后按 Ctrl + Shift + Enter 同时键,最大值所在的对应值 A2:A13 等于中的值 F1,以及中的相应值 B2:B13 等于中的值 F2 返回。

文档查找最大值 with-criteria-8

备注:要根据这些条件获得最小值,请应用以下公式: =MIN(IF(A2:A13=F1,IF(B2:B13=F2,C2:C13))),并记得按 Ctrl + Shift + Enter 钥匙在一起。


高级合并行:(基于键列查找最大值或最小值)

Kutools for Excel高级组合行 使用时,您可以根据关键列将多个重复的行快速组合到一条记录中,并且还可以对其他列应用一些计算,例如总和,平均值,计数等。

  • 1.指定要查找其他列基于的最大值或最小值的键列;
  • 2.选择所需的一种计算。

文档查找最大值 with-criteria-9

Kutools for Excel:具有200多个方便的Excel加载项,可以在60天内免费试用,没有任何限制。 立即下载并免费试用!


相关文章:

如何在Excel中使用max函数选择最大数据/值?

如何在Excel中选择最大值和最小值?

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Tip: use MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) or MINIFS...


The solution presented here is stupid and doesn't really work.
This comment was minimized by the moderator on the site
This was super helpful, thank you so much!
This comment was minimized by the moderator on the site
i'm finding min value from each cell (which not in a range), and it give me answer '-'. how to solve this? =min(A3, B3, D3, G3). but the B3 is zero.
This comment was minimized by the moderator on the site
Hello,

Similar to above example, where the MAX array formula finds the max value for KTE and Jan (two conditions) --> i am trying to do almost same, but i need to return not just the maximum value, but the name of the row which contains this maximum value... Imagine, if there is one more column between B and C, which contains the name of the person who did the order, for example... I was trying to use INDEX formula, but it doesn't really work. Like this: =INDEX(C2:C13,MAX(IF(A2:A13=F1,IF(B2:B13=F2,D2:D13)),0) What can be the solution here?
This comment was minimized by the moderator on the site
Hi,

I would like to get help to retrieve a value from a table based on an Object's Name (Multiple objects with multiple data from a same objects which differentiate by date) to get the latest data based on specified date ( more latest data may be available than the specified data).

No. Well Start Date End Date Oil Rates (stb/d)
1 BT-101L 1/1/2017 0:00 1/2/2017 0:00 59
2 BT-106L 1/7/2017 0:00 1/8/2017 0:00 124
3 BT-106S 1/8/2017 0:00 1/9/2017 0:00 132
4 BT-101L 1/9/2017 0:00 1/10/2017 0:00 138
5 BT-201S 1/10/2017 0:00 1/11/2017 0:00 144
6 BT-203S 1/11/2017 0:00 1/12/2017 0:00 150
7 BT-101L 1/29/2017 0:00 1/30/2017 0:00 269

In the results mode, I need to populate the data based on latest available data.

Date BT-101L
1-Jan 59
2-Jan 59
3-Jan 59
4-Jan 59
5-Jan 59
6-Jan 59
7-Jan 59
8-Jan 132
9-Jan 132
10-Jan 132
11-Jan 132
12-Jan 132
13-Jan 132
14-Jan 132
15-Jan 132
16-Jan 132

Can anyone help?
This comment was minimized by the moderator on the site
Similar question but based on reversed information. I work in land investment. I have a list of counties and corresponding values. The lower the value the more I need to work in the area. If I plug say "County A" with a value of 100, then County B with a value of 85, then County C with a value of 66, what statement can I use to identify County C as the one I need to work on?
This comment was minimized by the moderator on the site
Hi, when I try the MIN formula it doesn't work and just gives me 0??
This comment was minimized by the moderator on the site
Virtualcoyright - Do you have blanks in the range you are using the MIN for? If so, it will return with the following formula 0:

=MIN(IF(A2:A13=D2,B2:B13))

To prevent it getting 0 if blanks exist in the range B2:B13, write the formula in the following manner:

=MIN(IF(A2:A13=D2,IF(B2:B13<>0,B2:B13)))
This comment was minimized by the moderator on the site
Sir you have just saved my bacon ! I was facing a problem that i didn't have any blanks & all values where > 0 but the minimum formula resulted in 0 while i wanted the least positive value and your modified formula did just that. I think they should modify the article to include your modified formula.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations