我有一個像這樣的表(第一列):從一個數據庫,以便所有的數字自帶文本格式生成我有一列文字和文字格式的數字。如果數字;轉換。如果文本;返回文本
| Table | What I want to achieve |
|--------|------------------------|
| 088888 | convert to number |
| 88888 | convert to number |
| 588888 | convert to number |
| 688888 | convert to number |
| V44100 | ignore and return text |
| W44101 | ignore and return text |
| S54001 | ignore and return text |
| V44102 | ignore and return text |
| BOLUTY | ignore and return text |
| SHOLIA | ignore and return text |
|--------|------------------------|
表。
我想要一個公式,這將有助於將所有文本格式的數字轉換爲數字,如上面單元格中的前4個數字。該公式應該足夠聰明,不要試圖將文本轉換爲數字,即遇到文本時應該返回實際的文本。
我試圖使用=VALUE(A1)
,而它的工作原理爲高於第一4個數字,當它遇到真實文本(最後6個文本在以上表格的列A則返回#VALUE錯誤。
我有另一個式這樣(IF(OR(LEFT(A1)='1',LEFT(A1)='2',VALUE(A1),A1)
根據需要,但它會太長,因爲我想測試前綴號碼這工作0 through 9
即IF(OR) 0,1,2,3,4,5,6,7,8,9
等
是否有實現這一目標而不使用上面的超長式的短/簡單的方法?
謝謝。
你需要爲這個公式? Excel已經有一個內置的方法... –
你沒有背景錯誤檢查激活(綠色角落)點擊錯誤警告和轉換爲數字? – pnuts
@pnuts:Bullseye :) –