如何在Excel中基於一個或多個條件返回多個匹配值?
通常,對於大多數人來說,使用VLOOKUP函數查找特定值並返回匹配項很容易。 但是,您是否曾經嘗試過根據一個或多個條件返回多個匹配值,如下面的屏幕截圖所示? 在本文中,我將介紹一些解決Excel中復雜任務的公式。
根據一個或多個條件使用數組公式返回多個匹配值
例如,我要提取年齡為28歲且來自美國的所有姓名,請使用以下公式:
1。 將以下公式複製或輸入到要查找結果的空白單元格中:
=INDEX($B$2:$B$11, SMALL(IF(COUNTIF($F$2, $C$2:$C$11)*COUNTIF($G$2, $D$2:$D$11), ROW($A$2:$D$11)-MIN(ROW($A$2:$D$11))+1), ROW(A1)), COLUMN(A1))
備註:在以上公式中, B2:B11 是從中返回匹配值的列; F2, C2:C11 是第一個條件和包含第一個條件的列數據; G2, D2:D11 是第二個條件,包含此條件的列數據,請根據需要進行更改。
2。 然後按 Ctrl + Shift + Enter 鍵以獲取第一個匹配結果,然後選擇第一個公式單元格並將填充手柄向下拖動到這些單元格,直到顯示錯誤值,現在,所有匹配值都將返回,如下圖所示:
保養竅門:如果只需要根據一種條件返回所有匹配值,請應用以下數組公式:
=IFERROR(INDEX($B$2:$B$11, SMALL(IF($F$2=$D$2:$D$11, ROW($D$2:$D$11)-ROW($D$2)+1), ROW(1:1))),"" )
更多相關文章:
- 在一個逗號分隔的單元格中返回多個查找值
- 在Excel中,我們可以應用VLOOKUP函數從表單元格返回第一個匹配的值,但是有時,我們需要提取所有匹配的值,然後用特定的定界符(例如逗號,破折號等)分隔為單個單元格如下圖所示。 我們如何在Excel中的一個逗號分隔的單元格中獲取並返回多個查找值?
- Vlookup並在Google表格中一次返回多個匹配值
- Google表格中的常規Vlookup函數可以幫助您根據給定的數據查找並返回第一個匹配值。 但是,有時,您可能需要vlookup並返回所有匹配的值,如下圖所示。 您是否有任何簡便的方法可以解決Google表格中的此任務?
- Vlookup並從下拉列表中返回多個值
- 在Excel中,如何從下拉列表中進行vlookup並返回多個相應的值,這意味著當您從下拉列表中選擇一項時,其所有相對值會立即顯示,如以下屏幕截圖所示。 本文,我將逐步介紹解決方案。
- Vlookup並在Excel中垂直返回多個值
- 通常,您可以使用Vlookup函數來獲取第一個對應的值,但是有時,您希望基於特定條件返回所有匹配的記錄。 在本文中,我將討論如何進行vlookup並將所有匹配值垂直,水平或返回到單個單元格中。
- Vlookup並在Excel中返回兩個值之間的匹配數據
- 在Excel中,我們可以應用常規的Vlookup函數根據給定的數據獲取相應的值。 但是,有時,我們想要vlookup並返回兩個值之間的匹配值,如下面的屏幕截圖所示,您如何在Excel中處理此任務?
- 超級公式欄 (輕鬆編輯多行文本和公式); 閱讀版式 (輕鬆讀取和編輯大量單元格); 粘貼到過濾範圍...
- 合併單元格/行/列 和保存數據; 拆分單元格內容; 合併重複的行和總和/平均值...防止細胞重複; 比較範圍...
- 選擇重複或唯一 行; 選擇空白行 (所有單元格都是空的); 超級查找和模糊查找 在許多工作簿中; 隨機選擇...
- 確切的副本 多個單元格,無需更改公式參考; 自動創建參考 到多張紙; 插入項目符號,複選框等...
- 收藏并快速插入公式,範圍,圖表和圖片; 加密單元 帶密碼 創建郵件列表 並發送電子郵件...
- 提取文字,添加文本,按位置刪除, 刪除空間; 創建和打印分頁小計; 在單元格內容和註釋之間轉換...
- 超級濾鏡 (將過濾方案保存並應用於其他工作表); 高級排序 按月/週/日,頻率及更多; 特殊過濾器 用粗體,斜體...
- 結合工作簿和工作表; 根據關鍵列合併表; 將數據分割成多個工作表; 批量轉換xls,xlsx和PDF...
- 數據透視表分組依據 週號,週幾等 顯示未鎖定的單元格 用不同的顏色 突出顯示具有公式/名稱的單元格...
- 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
- 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
- 將您的工作效率提高 50%,每天為您減少數百次鼠標點擊!
Sort comments by
#42500
This comment was minimized by the moderator on the site
0
0
#42611
This comment was minimized by the moderator on the site
Report
0
0
#40996
This comment was minimized by the moderator on the site
0
0
#40979
This comment was minimized by the moderator on the site
0
0
#41662
This comment was minimized by the moderator on the site
Report
0
0
#39857
This comment was minimized by the moderator on the site
0
0
#39866
This comment was minimized by the moderator on the site
Report
0
0
#39790
This comment was minimized by the moderator on the site
0
0
#39819
This comment was minimized by the moderator on the site
Report
0
0
#39764
This comment was minimized by the moderator on the site
0
0
#39872
This comment was minimized by the moderator on the site
Report
0
0
#39494
This comment was minimized by the moderator on the site
Report
0
0
#39553
This comment was minimized by the moderator on the site
Report
0
0
#38736
This comment was minimized by the moderator on the site
0
0
#38760
This comment was minimized by the moderator on the site
Report
0
0
#38406
This comment was minimized by the moderator on the site
0
0
#38473
This comment was minimized by the moderator on the site
Report
0
0
#36375
This comment was minimized by the moderator on the site
0
0
There are no comments posted here yet