检查单元格中的第一个字母是否在Excel中的提供范围内


0

我在A栏中列出了一系列公司。我想要另一栏来检查这些公司的第一个字母是否属于{“a”,“b”,“c”,“d”,“e”的范围, “F”, “G”, “H”, “A”, “B”, “C”, “d”, “E”, “F”, “G”, “H”}。我想象LEFT会提供这个功能,如果我能用它来检查多个字符。

对于上下文,我将函数嵌套在几个IF中。

= IF(SEARCH( “**”,D112),IF(LEFT(A112,1)= { “一”, “B”, “C”, “d”, “E”, “F”, “G” ,“h”,“A”,“B”,“C”,“D”,“E”,“F”,“G”,“H”},“供应商AH”,IF(左(A112,1) )= { “I”, “J”, “K”, “L”, “M”, “N”, “O”, “p”, “I”, “J”, “K”, “L” ,“M”,“N”,“O”,“P”},“供应商JP”,IF(LEFT(A112,1)= {“q”,“r”,“s”,“t”,“ U”, “v”, “W”, “X”, “Y”, “Z”, “Q”, “R”, “S”, “T”, “U”, “v”, “W” , “X”, “Y”,”Z“},”供应商QZ“,”“))),”“)

Answers:


1

首先在某处(我称之为SearchList)创建一个包含值“a”到“h” 的命名范围。资本化被忽略,因此不需要同时包含大写和大写。

然后测试公式简单:

=MATCH(LEFT(A2,1),SearchList,0)

0

尝试这个 -

="Supplier "&IF(AND(CODE(UPPER(LEFT(A5,1)))>=CODE("A"),CODE(UPPER(LEFT(A5,1)))<=CODE("H")),"A-H",IF(AND(CODE(UPPER(LEFT(A5,1)))>=CODE("J"),CODE(UPPER(LEFT(A5,1)))<=CODE("P")),"J-P",IF(AND(CODE(UPPER(LEFT(A5,1)))>=CODE("Q"),CODE(UPPER(LEFT(A5,1)))<=CODE("Z")),"Q-Z","Not Alphabetical"))))


0

如果列表在A列中,请将其输入B1并向下拖动:

= IF(LEFT(A1,1)<“I”,“供应商AH”,IF(LEFT(A1,1)<“Q”,“供应商知识产权”,“供应商QZ”))

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.