excel 資料驗證

Step 1 首先要先在工具列「資料」中找到「資料驗證」

Step 2 在「儲存格內允許」選擇「自訂」,下方就會出現「公式」可以輸入
1. 只能輸入文字

公式「=ISTEXT(範圍)」
2. 不能輸入重複資料

公式「=COUNTIF(範圍,要被輸入的儲存格)=1」
COUNTIF的意思是,計算在選取的範圍內符合自訂值的數量
所以上述公式的意思就是在範圍內,新輸入的值只能存在1個!
3. 規定字首或字數

公式「=COUNTIF(要被輸入的儲存格,”規定字首+*”)=1」
「*」的意思是後面的字數沒有限制,如果希望限制字數可以使用「?」,一個「?」代表一個字,如果「王??」就表示只能輸入三個字,且字首規定為「王」
以上是一些常用的公式用法, 想知道如何出現錯誤訊息提示?請點我
【教學】Excel如何自訂公式限制儲存格的資料內容?不能輸入重複資料?