+ Reply to Thread
Results 1 to 6 of 6

Excel 2007 : Finding cells in a row that Do Not begin with

  1. #1
    Registered User
    Join Date
    05-25-2010
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Finding cells in a row that Do Not begin with

    Hi there folks,

    I Have some big excel files.
    What I have been trying to do, is select a column and fine all cells in that colums whose values do not begin with 0 (zero). And when these cells are found, a Zero should be given.

    However if that cell is empty as some of them are, then I want to ignore them.

    Any ideas?
    Last edited by Ahms; 06-15-2010 at 02:38 PM. Reason: solved

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Finding cells in a row that Do Not begin with

    In an empty column something like this:
    =--AND(A1>"",LEFT(A1,1)="0"))


    Copy that down the column and you will get 1 and 0 responses.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-25-2010
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Finding cells in a row that Do Not begin with

    Hi there, that was a cool idea you proposed. It made me realise my question was phrased in the wrong way! However for the way it was phrased you gave the perfect answer!

    I shall try to rephrase below:

    What the problem I have is, I have columns which contain phone numbers.
    When the data was put into excel, all of the cell phone numbers had the zero at the beginning cut off.
    The land line phone numbers still kept their zero.
    For example 07751226792 would have become 7751226792.
    Some rows contain records which do not have any phone number.

    I need to find a way of checking all of the cells in column of phone numbers to see if they begin with a zero. If they do not then I want to put the zero in.
    Thus turning cell phone numbers like 7751226792 back to the correct 07751226792!

    On a side note the suggestion to my incorrectly phrased question kindly posted by JBeaucaire was interesting. I have never used an expression like this in excel. (im a basic user)
    But seeing it in action got me thinking of maybe some kind of IF( THEN) expression utilising JBeaucaire's suggestion??

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Finding cells in a row that Do Not begin with

    Maybe something like:
    =IF(--AND(A1>"",LEFT(A1,1)="0"), A1, "0" & A1)

  5. #5
    Registered User
    Join Date
    05-25-2010
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Finding cells in a row that Do Not begin with

    Hey,
    Thanks so much.
    I have never had to do anything like this with excel, and you helped immensely. I understand what's happening. Its just different to IF, THEN clauses I have some across in my limited experience as I have only ever used them in C, or Java where we textually wrote the IF and THEN.
    Legend!

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Finding cells in a row that Do Not begin with

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1