+ Reply to Thread
Results 1 to 12 of 12

Conditional formatting for specific phone number format

  1. #1
    Registered User
    Join Date
    09-23-2014
    Location
    Seattle
    MS-Off Ver
    2010
    Posts
    25

    Conditional formatting for specific phone number format

    I would like to be able to highlight cells that do not match (000) 000-0000 format. Is there a way to do this?

    Please, and thank you!!!

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Conditional formatting for specific phone number format

    is this a format that you have applied to a cell to display a normal number in that format
    OR
    are you actually entering the text
    (000) 000-0000
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    09-23-2014
    Location
    Seattle
    MS-Off Ver
    2010
    Posts
    25

    Re: Conditional formatting for specific phone number format

    I have a report that calls a list from my NAV database. I have some typical conditional formatting rules applied to highlight blanks, and I'd love to be able to highlight cells that don't meet data entry standards. I want the phone number highlighted if the format of the phone number isn't in this format (xxx) xxx-xxxx. For example if the phone number is entered as 425-555-5044, it would be highlighted because it should have been entered as (425) 555-5044.

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Conditional formatting for specific phone number format

    you could test for characters

    assuming you select the column with the numbers in (say column A)

    =AND( LEFT(A1,1)="(", MID(A1,5,1)=")", MID(A1,6,1)=" ",MID(A1,10,1)="-")

    that will test all the characters for your format ( ) -
    BUT not if they put alpha characters in ie
    (425) A55-504B

  5. #5
    Registered User
    Join Date
    09-23-2014
    Location
    Seattle
    MS-Off Ver
    2010
    Posts
    25

    Re: Conditional formatting for specific phone number format

    Thanks etaf,

    I threw that in as a conditional formatting string, and nothing is happening. I changed the column numbers and played around with it a lot, but cannot seem to get it to work. Any advice, things to try?

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Conditional formatting for specific phone number format

    Please upload a sample of your workbook to the forum, Make sure you have removed any private information, remember this is a public forum and so available to anyone
    Would like to see an example of your data and also a manual mock up of the expected results you want to achieve.

    To attach a file to your post,
    click "Go advanced" (next to quick post),
    scroll down until you see "manage Attachments",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  7. #7
    Registered User
    Join Date
    09-23-2014
    Location
    Seattle
    MS-Off Ver
    2010
    Posts
    25

    Re: Conditional formatting for specific phone number format

    I think I've got a file attached. It's just a list of Grocery Stores, and I want to see all phone numbers that are not in this format (425) 555-5555, to get highlighted.

    The list is generated from a database call, so when the user opens the workbook, the list refreshes. I'd love to be able to have a conditional formatting rule that will check the phone format, and if it's not in this format (425) 555-5555, highlight the cell.

    Thanks for taking a look at it!!

    Paul
    Attached Files Attached Files

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Conditional formatting for specific phone number format

    create a rule
    highlight column G
    then use
    =AND(G1<>"",NOT(AND( LEFT(G1,1)="(", MID(G1,5,1)=")", MID(G1,6,1)=" ",MID(G1,10,1)="-")))

    that will also hightlight the title -
    otherwise you need to select the range as G2:G????
    and change all the G1 to G2 in the formula
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-23-2014
    Location
    Seattle
    MS-Off Ver
    2010
    Posts
    25

    Re: Conditional formatting for specific phone number format

    Thank you immensely. It's working!!!!!

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Conditional formatting for specific phone number format

    Small bug from etaf's in this case:

    (253) 299-5002

    if 1 (or more) digit after the "-" is missing, like (253) 299-500, or (253) 299-

    maybe 1 more condition for LEN must be added.
    Quang PT

  11. #11
    Registered User
    Join Date
    09-23-2014
    Location
    Seattle
    MS-Off Ver
    2010
    Posts
    25

    Re: Conditional formatting for specific phone number format

    How might that look?

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Conditional formatting for specific phone number format

    Something like this:

    =OR(SUMPRODUCT(--(MID(G2,{1,5,6,10},1)={"(",")"," ","-"}))<4,LEN(G2)<>14)

+ 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. Replies: 2
    Last Post: 09-26-2014, 09:01 PM
  2. [SOLVED] Conditional Formatting specific number of columns
    By JZ119 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2014, 09:51 PM
  3. [SOLVED] Conditional formatting for number format
    By Copenworld in forum Excel General
    Replies: 3
    Last Post: 03-02-2014, 08:49 PM
  4. Conditional Formatting - Format row based on cell value in specific column
    By Kite3 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-08-2013, 12:23 AM
  5. how do I add phone number format as a permanent custom format?
    By frustratedagain in forum Excel General
    Replies: 3
    Last Post: 02-03-2006, 11:52 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