请问excel中LOOKUP(MID(A2,3,2),{"01","02","03"},{"1班","2班","3班"}

1个回答

  • LOOKUP(MID(A2,3,2),{"01","02","03"},{"1班","2班","3班"})

    意思为如果A2单元格从第三个字符起取两个字符与数组中{"01","02","03"}中第某项相同,则返回另一个数组{"1班","2班","3班"}中的第某项内容

    假设A2单元格的内容为 220345 则 MID(A2,3,2) 返回 "03"

    而"03"是{"01","02","03"}中的第三项,所以公式返回{"1班","2班","3班"}中的第三项即"3班"

    这个公式可以简写成

    LOOKUP(--MID(A2,3,2),{1,2,3},{"1班","2班","3班"})

    =--MID(A2,3,2)&"班"