Consulting

Results 1 to 6 of 6

Thread: Solved: Check if cell begins with number

  1. #1

    Solved: Check if cell begins with number

    Is there any way I can use an IF statement to see if a cell begins with a 2 (or a 3 or 4)?

    Thanks

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =IF(LEFT(A2,1)="2","yes","no")
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    =IF(AND(--LEFT(A1,1)>1,(--LEFT(A1,1)<5)),TRUE,FALSE)
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    = IF(AND(49<CODE(A1),CODE(A1)<53),"yes","no")

  5. #5
    With the below formula you will be able to check any number if exist...

    =ISNUMBER(VALUE(LEFT(A1,1)))







    ...

  6. #6
    Thanks for all your replies.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •