+ Reply to Thread
Results 1 to 8 of 8

how to not count a cell congaing certain characters

  1. #1
    Registered User
    Join Date
    02-26-2015
    Location
    New Lenox, IL
    MS-Off Ver
    2010
    Posts
    3

    how to not count a cell congaing certain characters

    I created a formula that counts text AB, BC, CD, DE, etc. In the formula I use "AB*" and the same for each individual set of letters for a wildcard. My problem is that in that same set of cells there could possible be text that has a * in it like this. AB* which means that this person is working extra. I used the formula to count how many times AB is in the cells I have put in the formula. How do I get it to NOT count if there is and AB*? I tried to do a -Countif, but when I did that is subtracted how many times AB* appeared. I hope this makes sense and that you can help me. Thanks.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: how to not count a cell congaing certain characters

    Hi MoparGirl and welcome to the forum.

    If you are working on a single cell and you want to count how many "AB" are in that string, here is the plan.

    Replace all "AB" in the string with "" (nothing). Now see if the string is shorter using Len(). It will be 2 characters shorter for each "AB" replaced by nothing.

    That is the plan on counting stuff in a string in a single cell.

    You need to show a sample of your work for us to see if that is the real problem.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: how to not count a cell congaing certain characters

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    02-26-2015
    Location
    New Lenox, IL
    MS-Off Ver
    2010
    Posts
    3

    Red face Re: how to not count a cell congaing certain characters

    Excel Forum Sample.xlsx

    I figured out that my cell range regarding the previous question was too broad. Now, I was wondering if you could help me to make the formula less cumbersome, I know there has to be a shorter stream to get the same result. Also, this is my first time attaching a document in the forum I hope I did it right.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: how to not count a cell congaing certain characters

    Hi MoparGirl (is that a golf alias?)

    Try this formula for counting all the "AB" or "AB*" in your columns.

    =COUNTIF(C:E,"AB")+COUNTIF(C:E,"AB?")

    "AB?" should mean everything that starts with AB and has a single character after it.
    "AB*" should mean everything that starts with AB and has anything after it.

  6. #6
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: how to not count a cell congaing certain characters

    Quote Originally Posted by MarvinP View Post
    Hi MoparGirl (is that a golf alias?)
    Are golf carts Chrysler powered now?
    Happy with my advice? Click on the * reputation button below

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: how to not count a cell congaing certain characters

    I thought she wanted More Par Scores while playing golf...

  8. #8
    Registered User
    Join Date
    02-26-2015
    Location
    New Lenox, IL
    MS-Off Ver
    2010
    Posts
    3

    Re: how to not count a cell congaing certain characters

    No, it is definitely a classic car reference. My favorite, a 1969 Plymouth Barracuda.

+ 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] Count No. of characters in a cell
    By nagesh.tvsr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-13-2014, 05:02 AM
  2. [SOLVED] Can I count characters in a cell
    By tuph in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-26-2014, 10:09 PM
  3. Count Characters in a Cell
    By TOTO_POP in forum Excel General
    Replies: 2
    Last Post: 08-06-2010, 06:03 AM
  4. Macro to count characters in a cell
    By chromachem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2010, 10:57 AM
  5. Count Number of Characters in a cell?
    By AHJuncti in forum Excel General
    Replies: 2
    Last Post: 06-16-2005, 02:39 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