+ Reply to Thread
Results 1 to 3 of 3

Identify Cells Where a Punctuation is Followed by a Character

  1. #1
    Forum Contributor
    Join Date
    11-10-2011
    Location
    New York, NY
    MS-Off Ver
    MS Office: Excel 365
    Posts
    163

    Identify Cells Where a Punctuation is Followed by a Character

    Hi!

    Hoping ysomeone can assist me with something.

    I have a file with multiple rows of text strings. I need to be able to identify which cells include punctuation that are not followed by a blank ("") or space (" ") - i.e. if followed by another character.

    There are only 4 punctuation marks I'm worried about: comma (,), period (.), exclamation mark (!), question mark (?)

    I've tried for over a day now and can't seem to find a solution.
    Below is an example of 6 text strings (the 1st, 5th, and 6th rows fit the description outlined above):

    asdfjhskhdfjwwww! Aaa,a
    asdfasdfsf. Aaaa, a.
    wellaaaa, asdfasdf, w.
    asdfasdf. Asdfasdf, asas,
    isnvojfdsn.oijbve ,oksh
    jbvs, poihvokds?j

    thank you!

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Identify Cells Where a Punctuation is Followed by a Character

    Try the formula below in B1 (If your data starts in A1) and fill down. I didn't know what to call the instances, so PUNCCHAR pops up if there's punctuation followed immediately by a character. NOPUNCCHAR if not. You'll want to change those returns to suit your needs.

    =IF(IFERROR(FIND("@",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A1&" ","?","@"),".","@"),",","@"),"!","@"),"@ ","")),0)>0,"PUNCCHAR","NOPUNCCHAR")
    Last edited by CAntosh; 04-06-2016 at 01:35 PM.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Identify Cells Where a Punctuation is Followed by a Character

    Hi,

    Just been working on something similar to cantosh's suggestion but as a conditional format. So adapting Cantosh's offering as a CF then

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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: 4
    Last Post: 08-26-2014, 09:20 AM
  2. [SOLVED] Quick Question: Select Case to identify if first character of a cell is "6"
    By exlgh91 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-16-2013, 10:25 AM
  3. Macro to highlight cells which have content with an end punctuation
    By Athi123 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-31-2013, 03:04 AM
  4. Replies: 1
    Last Post: 03-12-2012, 10:33 AM
  5. Replies: 2
    Last Post: 02-02-2012, 12:02 PM
  6. Replies: 2
    Last Post: 07-19-2011, 05:47 PM
  7. macro code to identify fonts character by character
    By Orzabal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2007, 04:52 PM

Tags for this Thread

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