跳到主要內容

如何根據Excel中的條件查找最大值或最小值?

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

假設我具有以下數據范圍,A列包含產品名稱,B列包含訂單數量,現在,我想查找產品KTE的最大訂單價值,如以下屏幕截圖所示。 在Excel中,我們如何根據一個或多個條件提取最大值或最小值?

僅基於一個條件找到最大值或最小值

根據多個條件找到最大值或最小值


箭頭藍色右氣泡 僅基於一個條件找到最大值或最小值

要使用一個條件返回最大值或最小值,請使用MAX函數。

1。 輸入以下公式: =MAX((A2:A13=D2)*B2:B13) 放入所需的特定單元格,請參見屏幕截圖:

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

保養竅門:在此公式中: 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

保養竅門:在此公式中: 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 鑰匙在一起。


高級合併行:(基於鍵列查找最大值或最小值)

這款獨特的敏感免洗唇膜採用 Moisture WrapTM 技術和 Berry Mix ComplexTM 成分, Excel的Kutools高級合併行 實用時,您可以基於關鍵列將多個重複的行快速組合到一條記錄中,並且還可以對其他列應用一些計算,例如總和,平均值,計數等。

  • 1.指定要查找其他列基於的最大值或最小值的鍵列;
  • 2.選擇所需的一種計算。

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

Excel的Kutools:具有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選項卡為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