同时使用Mid和IF:如果在逻辑testing中有多个variables,会怎么样?

所以我的公式如下所示:= IF(MID([@ [bin_id]],9,1)=“a”,MID([@ [bin_id]],9,1),“PALLET”)

我唯一的问题是我想为我的逻辑testing使用几个variables。 基本上我想说这个:

如果我的中等公式等于“a,b,c,d,e,f,g”,那就把它放在一边。 如果不等于这些variables,则返回文本“托盘”。

我这样做是因为我的单元格“bin_id”有bin位置,不幸的是pallet位置被标记为更短,所以当我使用我的MID公式时,它不会返回我想要的variables。

备用解决scheme:

=IF(OR(MID([@[bin id]],9,1)={"a","b","c","d","e","f","g"}),MID([@[bin id]],9,1),"PALLET") 

使用:

 =IFERROR(INDEX({"a","b","c","d","e","f","g"},MATCH(MID([@[bin_id]],9,1),{"a","b","c","d","e","f","g"},0)),"PALLET") 

要么:

 =IF(ISNUMBER(MATCH(MID([@[bin_id]],9,1),{"a","b","c","d","e","f","g"},0)),MID([@[bin_id]],9,1),"PALLET")