+ Reply to Thread
Results 1 to 3 of 3

Count the number of cells that contain text in the number

  1. #1
    Registered User
    Join Date
    11-06-2003
    MS-Off Ver
    2013
    Posts
    75

    Count the number of cells that contain text in the number

    Column A contains numbers. There are a few cells in Column A that have a "x" place in front of the number. Column B shows whether this item is open or closed. I need a formula that will count the number of cells in column A that contain the letter x.

    I would then be able to create a pivot table that would show me the number of x'd items that are open and the number that are closed.

    Example:
    1098165-02 closed
    x100629-01 open
    x100629-02 closed
    100104-01 closed

    I need to show that there are two in the above list that contain the letter x. One is open, One is closed.

    Thanks so much for you help.
    Last edited by dcoates; 08-16-2010 at 10:50 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Count the number of cells that contain text in the number

    Given the Pivot requirement it would make sense to store a 1/0 flag adjacent to each transaction denoting the presence of "x" in the string, eg:

    C1: "X-Type"
    C2: =0+(LEFT(A2)="x")
    copied down

    You can then generate both Pivot and count of x quite simply (use the X-Type field as Page Field in your Pivot set to 1)

    (for a single cell calc of "x" you can use COUNTIF(range,"x*") but given you have the 1/0 flag there's little need)

  3. #3
    Registered User
    Join Date
    11-06-2003
    MS-Off Ver
    2013
    Posts
    75

    Re: Count the number of cells that contain text in the number

    Thanks, the second formula worked for what I needed. This information comes from an external source that I have no control on how the data is exported. I was trying to create a formula in another column so that I would not have to put in data manually. By using the second formula that you suggested in C2, I can now create the pivot table that shows me the number of extensions and whether they are open or closed.

    Thanks again for your quick solution.

+ 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