跳到主要內容

如何在Excel中創建下拉列表忽略空白單元格?

假設您有一個包含多個空白單元格的值列表,當使用此數據列表創建數據驗證下拉列表時,即使您已選中“忽略”,也會發現空白單元格已添加到下拉列表創建時為空白選項。 實際上,沒有空白單元格的直接創建方法。 在本教程中,我們將為您提供一個技巧,可以根據原始數據分隔值和空白單元格,最後為提取數據創建一個下拉列表。

創建下拉列表忽略Excel中的空白單元格


創建下拉列表忽略Excel中的空白單元格

例如,您在B2:B13範圍內具有以下數據,用於創建不帶空白單元格的下拉列表,首先,您可以將數據複製並粘貼到不帶空格的新列中。 然後基於此新值列表創建一個下拉列表。

1.應用以下公式僅複製和粘貼非空白單元格值,請輸入此公式: =LOOKUP("zzzzz",CHOOSE({1,2},"",INDEX(B:B,SMALL(IF($B$1:$B$13<>"",ROW($B$1:$B$13)),ROWS($D$1:D1))))) 放入一個空白單元格D1,然後按 按Ctrl + 轉移 + Enter 一起獲得以下結果:

備註:在上面的公式中,B1:B13是您要使用的數據列表。 您可以根據需要更改單元格引用。

2.然後選擇單元格D1,並將填充手柄向下拖動到要包含此公式的範圍,並且已提取所有非空白單元格值。 看截圖:

3.現在使用此新數據列表創建數據驗證下拉列表。 選擇要查找下拉列表的單元格,然後單擊 數據 > 數據驗證.

4。 在裡面 數據 驗證對話框,您需要:

1)。 轉到“設置”標籤,然後選擇 名單 ,在 下拉列表;
2)。 選擇單元格區域,其中包含您在上方從中提取的值 資源 框;
3)。 點擊 OK 按鈕。 看截圖:

5.然後立即創建下拉列表,不帶空格。


相關文章:

最佳辦公生產力工具

🤖 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 (7)
Rated 1 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
kalo setting validate nya tetep dari D1:D10 ya percuma pak.
kalau isiannya jadi 11 kan jadinya ada yg gak masuk list.
This comment was minimized by the moderator on the site
Hi Fadli,

Sorry, I don't quite understand your question. This trick helps to extract all the values from the list, excluding the blank ones. You need to make sure that all values are extracted and then create a dropdown list based on the extracted values.
This comment was minimized by the moderator on the site
Hilft leider nicht weiter, wenn man die Anzahl an Zeilen nicht kennt.
In meinem Fall habe ich eine Liste mit bis zu 40 Einträgen und aus einer der Spalten soll ein Drop-Down-Feld erstellt werden. Da ich aber nicht weiß wieviel Einträgen das sind muss ich immer noch, wenn sich die Liste ändert, das Drop-Down-Feld neu erzeugen und das für über 100 Listen jede Woche neu. Da hilft dann auch kein VBA, denn das kann zwar die Zeilen herausfinden, aber bei Änderungen (in mehr Einträge fehlen die neuen, in weniger Einträge sind am Ende wieder Leerzeilen) muss das VBA-Makro auch ständig wieder ausgeführt werden.
Rated 1 out of 5
This comment was minimized by the moderator on the site
The idea of having to create a second column seems a work around a defective option. The check box right beside the allow option says to ignore blanks. What is the real function of this check box if it does NOT ignore the blanks.
This comment was minimized by the moderator on the site
<p>The function works perfectly for me, but I still have one question. In my case I need to apply the formula for column range 2:2 instead of row range B:B.</p><p>Many thanks</p>
This comment was minimized by the moderator on the site
Suggestion: Just copy and paste with transpose (columns to rows) then press F5 (go to) select special and click on blanks. then delete the cells.
This comment was minimized by the moderator on the site
<p>The function works perfectly for me, but I still have one question.</p><p>how do i make this work?</p><p>Many thanks</p>
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations