+ Reply to Thread
Results 1 to 8 of 8

Conditional formatting if a number starts with specific digits

  1. #1
    Registered User
    Join Date
    03-01-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Conditional formatting if a number starts with specific digits

    I am trying to apply condtional formatting to highlight the cells in D column if it starts with 91099 or 91004.
    I tried to do the same using wild card, and left function but didn't get the desired output.
    Can somebody help me out?

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Conditional formatting if a number starts with specific digits

    Try

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Conditional formatting if a number starts with specific digits

    =LEFT(D3,5)="91004" or for both
    =OR(LEFT(D3,5)="91004",LEFT(D3,5)="91099")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    03-01-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Conditional formatting if a number starts with specific digits

    Thanks Fotis. It really worked.

    I also tried doing it but without adding "0" so it wasn't working. So can you please tell me logic behind adding "0".

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Conditional formatting if a number starts with specific digits

    you either do it with real numbers by adding 0 or you use text as i showed text "99999" plus 0 =real number 99999

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Conditional formatting if a number starts with specific digits

    When you use the functions LEFT, MID, RIGHT, Excel get these values as Text. So you need to convert in numbers adding a zro(0).

  7. #7
    Registered User
    Join Date
    03-01-2013
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Conditional formatting if a number starts with specific digits

    Thanks Fotis

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Conditional formatting if a number starts with specific digits

    You are welcome and thanks for the feedback & rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] conditional formatting in case field starts with +
    By Ir1e in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-28-2013, 05:51 PM
  2. Replies: 1
    Last Post: 05-17-2013, 04:56 AM
  3. [SOLVED] Conditional formatting, highlight multiple of a specific number
    By Mihail-Cosmin in forum Excel General
    Replies: 11
    Last Post: 03-21-2012, 12:16 PM
  4. Replies: 3
    Last Post: 02-12-2009, 01:08 PM
  5. Formatting specific digits
    By Lynx34 in forum Excel General
    Replies: 3
    Last Post: 08-07-2008, 12:25 PM

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