+ Reply to Thread
Results 1 to 6 of 6

Count how many times a substring occurs in a column

  1. #1
    Forum Contributor
    Join Date
    03-15-2016
    Location
    Vancouver, Canada
    MS-Off Ver
    w 10, Excel 2016
    Posts
    125

    Count how many times a substring occurs in a column

    Hi everyone. I'm trying to determine how many times the word "MESA" occurs in a column of text messages (but only count ONE occurrence per row if it is there more than once in a cell). I can't quite get the formula right. I think I need to use COUNTIF and FIND - but doesn't seem to work. Here is the column of text. I can't attached the xls because of confidentiality, but this is column H:

    ALARMS - RES - ALARMS - SF RESIDENTIAL
    MESA-D - MESA-D
    WIRES DOWN - WIRES DOWN
    MESA-C - MESA-C

    MESA-B - MESA-B
    ALARMS - RES - ALARMS - SF RESIDENTIAL
    MESA - MESA
    MESA-D - MESA-D
    MESA-C - MESA-C
    WIRES DOWN - WIRES DOWN
    MESA-C - MESA-C
    MESA-D - MESA-D
    ALARMS - RES - ALARMS - SF RESIDENTIAL
    MESA - MESA
    MESA-D - MESA-D
    MESA-D - MESA-D
    MESA-D - MESA-D
    MESA-D - MESA-D
    BURNING COMP - BURNING COMPLAINT
    BURNING COMP - BURNING COMPLAINT
    ALARMS - NON-RES - ALARMS RINGING - MR / COMMERCI
    MESA-D - MESA-D
    MESA-D - MESA-D
    MESA-C - MESA-C
    ALARMS - RES - ALARMS - SF RESIDENTIAL
    ALARMS - RES - ALARMS - SF RESIDENTIAL
    MESA-D - MESA-D
    MISC/Other - MISC/OTHER/SPECIAL/NOT LISTED
    BURNING COMP - BURNING COMPLAINT
    MESA-C - MESA-C
    MVA - MVA
    MESA-D - MESA-D
    LIFT ASSIST - LIFT ASSIST
    BURNING COMP - BURNING COMPLAINT
    BURNING COMP - BURNING COMPLAINT
    MESA-B - MESA-B
    MESA-D - MESA-D
    MESA-C - MESA-C
    MESA-D - MESA-D
    ALARMS - RES - ALARMS - SF RESIDENTIAL
    MISC/Other - MISC/OTHER/SPECIAL/NOT LISTED
    BURNING COMP - BURNING COMPLAINT
    MESA-D - MESA-D
    BRUSH FIRE - BRUSH/GRASS FIRE
    RESCUE - OTHER - RESCUE - OTHER
    MISC/Other - MISC/OTHER/SPECIAL/NOT LISTED
    NG LEAK/SMELL - NATURAL GAS LEAK/SMELL
    MESA-D - MESA-D
    ALARMS - RES - ALARMS - SF RESIDENTIAL

    CO ALARMS - CARBON MONOXIDE ALARMS
    STR FIRE - POSSIBLE - STRUCTURE FIRE - POSSIBLE
    STR FIRE - POSSIBLE - STRUCTURE FIRE - POSSIBLE
    MESA-D - MESA-D

    MESA-D - MESA-D
    ALARMS - RES - ALARMS - SF RESIDENTIAL
    MISC/Other - MISC/OTHER/SPECIAL/NOT LISTED
    MESA-D - MESA-D
    MESA-A - MESA-A
    BURNING COMP - BURNING COMPLAINT
    BURNING COMP - BURNING COMPLAINT
    ALARMS - RES - ALARMS - SF RESIDENTIAL

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Count how many times a substring occurs in a column

    It seems this should work >> =COUNTIF(H1,"*Mesa*")

    What result do you expect? I get a sum of 29
    HTH
    Regards, Jeff

  3. #3
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Count how many times a substring occurs in a column

    This returns 29 also: =SUM(N(ISNUMBER(FIND("MESA",H1:H99))))

  4. #4
    Forum Contributor
    Join Date
    03-15-2016
    Location
    Vancouver, Canada
    MS-Off Ver
    w 10, Excel 2016
    Posts
    125

    Re: Count how many times a substring occurs in a column

    Thanks very much for your help Hans and Jeff. Both of these works well - I didn't realize that "*" could be used - you taught me something! Thanks!

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,318

    Re: Count how many times a substring occurs in a column

    You are very welcome. Glad we could help!

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Count how many times a substring occurs in a column

    You are Welcome!

    Thanks for the feedback and rep . Glad to have helped.

+ 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 times name occurs in a week
    By arrowmaker100 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2023, 09:03 AM
  2. [SOLVED] Count how many times a value occurs IN A ROW [consecutively]
    By helloxxx in forum Excel General
    Replies: 8
    Last Post: 07-22-2019, 02:47 AM
  3. [SOLVED] Count the number of times each date occurs
    By Shahbazk in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-07-2017, 09:14 AM
  4. Replies: 10
    Last Post: 07-18-2014, 06:11 AM
  5. Count the number of consecutive times a value occurs
    By mbhc77 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-09-2014, 07:58 AM
  6. Count how many times a letter occurs
    By GreenMartian in forum Excel General
    Replies: 2
    Last Post: 03-15-2009, 04:30 AM
  7. I would like to count the # of times a value occurs in Col B base
    By shopaholic in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-09-2005, 12:30 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