2017-04-20 53 views
0

早上好, 我想檢查細胞以查看它們是否是落入A,B或C類與下面的Excel公式,的Excel /配方限制與255個字符與if語句

=IF(CB3=0,"", 
(IF(N3=" 
215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 324, 325, 326, 327, 328, 329, 330, 331, 336, ","A", 

IF(N3="215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, "B", 

IF(N3="301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 324, 325, 326, 327, 328, 329, 330, 331, 336, ","C", 
IF(LEN(N3)=0,"",LEFT(N3,(LEN(N3)-2)))))))) 

我已經看到255個文本限制錯誤,所以我無法處理它,Excel表示我可以使用CONCATENATE或&,但不知道我可以用這個做什麼。有什麼建議麼?非常感謝!

+0

嘗試使用另一個公式,你能解釋你的nee d並顯示您的數據? – yass

+0

我需要從中看到,我希望細胞向我展示細胞屬於類別(A,B或C),如果沒有,請顯示一組模型。 (等215:216,217 ..) – zzaewon

回答

2

它抱怨這個一個很長的文本字符串,你是來進行測試:

"215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 324, 325, 326, 327, 328, 329, 330, 331, 336, " 

相反,使用連接來打破它:

CONCATENATE("215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 246, 247, 248, 249, 250, 251,", " 252, 253, 254, 255, 256, 257, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 324, 325, 326, 327, 328, 329, 330, 331, 336, ") 

這兩個在功能上等同串連剛將兩根琴絃粘在一起成長。

所以......所有我們這裏做的是打破了你很長的字符串,如:

="This is a very long string, isn't it" 

成兩個較小的字符串,並串聯在一起,他們說:

=Concatenate("This is a very long ", "string, isn't it") 

這兩個公式的功能相當於因爲得到的值將是

This is a very long string, isn't it 
+0

= IF(CC3 = 0,IF(N3 = CONCATENATE(215,216,217,218,219,220,221,222,223,224,225,226,227 ,228,229,230,231,232,233,234,246,247,248,249,250,251,252,253,254,255,256,257,),「A」,我嘗試過這些,但是,它使我發現215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,246,247,248,249 ,250,251,252,253,254,255,256,257,而不是A,我錯過了什麼?謝謝JNevill! – zzaewon

+0

你需要連接兩個字符串,它們需要用引號引起來。如果你對'= concatenate()'的工作方式感到困惑,可以在這個非常大的'if'公式之外嘗試一下,看看結果如何:你的公式應該如下所示:'= IF(CC3 = 0,IF (N3 = CONCATENATE(「215,216,217,218,219,220,221,222,223,224,225,226,227,228,229, 248,249,250,251「,」252,253,254,2「 (例如圖55,256,257,301,302,303,304,305,306,307,308,309,310,311,324,325,326,327,328,329,330,331,336,「)」,以及「 A「,' – JNevill

+0

這很有效,謝謝先生! – zzaewon