如果单词以后缀之一结尾,则标记为1

假设我有这个。

Words             Mark                 Suffix
Happily                                ly
Emotional                              dom                              
Emotionally
Surfdom

如果单词在后缀列表中以某些后缀结尾,我想标记为1,否则为0。

Words             Mark                 Suffix
Happily            1                   ly
Emotional          0                   dom                              
Emotionally        1
Surfdom            1

I tried lookup and vlookup but they are incomplete. How can I do this?

评论
  • pculpa
    pculpa 回复

    If those three columns are A,B & C then B2 = =IF(OR(RIGHT(A2,LEN($C$2))="ly",RIGHT(A2,LEN($C$3))="dom"),1,0)

    如果您在C列中有大量数据,则此方法不合适。在这种情况下,您可能需要VBA解决方案。