How to check first character in a cell value

后端 未结 3 740
一向
一向 2021-01-29 06:30

I was wondering if there is a way to check the first character in a cell value.

E.g

01999102477490 ( first char \"0\" )

11003200602650 (first cha         


        
3条回答
  •  日久生厌
    2021-01-29 06:55

    IF(logical_test, [value_if_true], [value_if_false])
    

    Using the above you can do the following:

    IF(LEFT(A1,1)="0","0",IF(LEFT(A1,1)="1","1","Neither"))
    

    Replace A1 with the cell you want to test

    Replace the "0" between the commas with whatever you want to do with those values that start with 0

    Replace the "1" between the commas with whatever you want to do with those values that start with 1

    Replace "Neither" with whatever you want to do with those values that don't start with 0 or 1

提交回复
热议问题