If Cell Starts with Text String… Formula

后端 未结 3 1577
悲哀的现实
悲哀的现实 2021-02-12 12:05

I have formula that checks if the cell starts with text \"A\" returns Pick up \"B\" for Collect and C for Prepaid.

But it doesn\'t seems to be working properly

B

3条回答
  •  逝去的感伤
    2021-02-12 12:45

    I'm not sure lookup is the right formula for this because of multiple arguments. Maybe hlookup or vlookup but these require you to have tables for values. A simple nested series of if does the trick for a small sample size

    Try =IF(A1="a","pickup",IF(A1="b","collect",IF(A1="c","prepaid","")))

    Now incorporate your left argument

    =IF(LEFT(A1,1)="a","pickup",IF(LEFT(A1,1)="b","collect",IF(LEFT(A1,1)="c","prepaid","")))

    Also note your usage of left, your argument doesn't specify the number of characters, but a set.


    7/8/15 - Microsoft KB articles for the above mentioned functions. I don't think there's anything wrong with techonthenet, but I rather link to official sources.

    • lookup
    • hlookup
    • vlookup
    • if
    • left

提交回复
热议问题