+ Reply to Thread
Results 1 to 10 of 10

Count with multiple text in a cell

  1. #1
    Registered User
    Join Date
    03-13-2025
    Location
    Sydney
    MS-Off Ver
    MS365
    Posts
    7

    Count with multiple text in a cell

    Hello

    I have an incident dataset with multiple text values (with alt+return as delimiter) for incident category, as shown in column B in the attached file.

    What I want is to create a report based on a reporting category (column E) if it is in column B. For example, for ID 2368653, it will be counted in reporting category Collision, Collision/Near Hit, Near Miss with Person, Near Hit. for ID 2809463, it will be counted in reporting category Collision/Near Hit, Collision, Near Hit, Near Miss with Person, and so on. And total count of Collision will be returned in cell F4, total count of Collision/Near Hit will be returned in cell F5, and so on.

    I used Search function to create a metrix. But it double count Near Hit because it appears in Collision/Near Hit category as well.

    Can anybody help me to solve the issue? I use Microsoft 365.

    Many thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,952

    Re: Count with multiple text in a cell

    One way would be to use TEXTSPLIT to separate the values out into separate columns based on the alt+return (CHAR(10)), then use COUNTIF on the results.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    See attached.

    BSB
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-13-2025
    Location
    Sydney
    MS-Off Ver
    MS365
    Posts
    7

    Re: Count with multiple text in a cell

    This is brilliant. Thank you very much.

    where can I get a list of delimiters? eg. CHAR(10) for alt+return, what is for comma or hyphen etc?

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: Count with multiple text in a cell

    Here: https://www.ascii-code.com/

    But hyphens and commas would go into the formula as is: =TEXTSPLIT(B4,",") or =TEXTSPLIT(B4,"-")

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,952

    Re: Count with multiple text in a cell

    Ali's link will give you all the codes, but you can get them quickly within Excel by putting the character in a cell and using the CODE function to find it. i.e. a comma in A1 and the formula =CODE(A1) will return the relevant CHAR value. 44 for a comma, 45 for a hyphen etc.

    BSB

  6. #6
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,931

    Re: Count with multiple text in a cell

    Clear all expected results.
    Try this in F4.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: Count with multiple text in a cell

    Administrative Note:

    Is your forum profile up-to-date and showing ONLY the oldest Excel PRODUCT that you need this to work for? There is no Excel 11 ...

    Members will tailor the solutions they offer to the Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your product is for Mac, please also state this.

    The four most recent Excel products are Excel 2019, Excel 2021, Excel 2024 and MS365 - if you are using MS365, please give this name along with the version number in your profile (e.g. MS365 Version 2306). This is in the About Excel section further down the Account page.

    Thanks.

  8. #8
    Registered User
    Join Date
    03-13-2025
    Location
    Sydney
    MS-Off Ver
    MS365
    Posts
    7

    Re: Count with multiple text in a cell

    Hi All

    Thank you very much for your help. You're all genius!!!

  9. #9
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,931

    Re: Count with multiple text in a cell

    You are welcome.

  10. #10
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    4,011

    Re: Count with multiple text in a cell

    CELL F4 FORMULA
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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: 7
    Last Post: 12-03-2019, 10:44 AM
  2. Count no. of lines of text in a text wrapped cell
    By mjmitch in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-27-2018, 08:37 AM
  3. Replies: 6
    Last Post: 08-19-2015, 07:46 PM
  4. [SOLVED] Count # of times text appears in cell range by cell referencing not =countif(A:A, ="text")
    By smit.etha in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-20-2014, 04:09 AM
  5. Multiple Criteria search and COUNT FOR TEXT across multiple sheet ARRAY's
    By akaushik25 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-25-2014, 08:58 AM
  6. [SOLVED] Multiple Condition Cell Count with Text
    By majixx11 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-22-2012, 07:22 PM
  7. Count multiple rows (text) with multiple criteria (text)
    By alecabral08 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-21-2008, 04:26 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