+ Reply to Thread
Results 1 to 9 of 9

Countif counting letters

  1. #1
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Countif counting letters

    Hi ...
    Came across a peculiar event today.
    Sitting here on a Saturday night doing absolutely worthless and useless work in Excel, one has to be a nerd.

    I need to count the number of certain letters in a row. So I have this formula, see attached spreadsheet, to do so.
    The formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    will set a "h" in the cells B5 and C5, ready to be counted.
    The formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    in the row below counts them.
    The formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    in the adjacent cell puts a "hh"' in cell D4.
    The formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    in E5 counts only cells with one "h" in each. The answer should be three.

    How can I count how many "h"'s there are i a row, even in cells containing a string with a varying number of "h"'s in it?
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Countif counting letters

    Seems to be a problem opening the attachment. Tried twice and it tells me the file is corrupt. Maybe try again.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Re: Countif counting letters

    Okay ... Sorry about that.
    It works fine here on my computer.
    But re-uploaded it once again just now.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Countif counting letters

    F5=LEN(B5&C5)-LEN(SUBSTITUTE(B5&C5,"h",""))

  5. #5
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Re: Countif counting letters

    Hi CaraCalla:
    Did yo test this in the spreadsheet?
    It won't work here.
    And I have of course translated it correctly.

  6. #6
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781
    Also , with ;

  7. #7
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Re: Countif counting letters

    Yupp ... of course

  8. #8
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,409

    Re: Countif counting letters

    Quote Originally Posted by Tresfjording View Post
    Hi CaraCalla:
    Did yo test this in the spreadsheet?
    It won't work here.
    CARACALLA's formula works fine for me inside of the file you posted. When you say "it won't work here", what exactly happens when you try it?

  9. #9
    Forum Contributor
    Join Date
    08-30-2015
    Location
    Tresfjord, Norway
    MS-Off Ver
    365
    Posts
    169

    Re: Countif counting letters

    Sorry .. My bad ....
    I used the Norwegian ERSTATT instead of BYTT when replacing SUBSTITUTE.
    It works fine now!
    Thank you!

+ 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] Counting letters
    By kevincoxshall in forum Excel General
    Replies: 2
    Last Post: 08-14-2013, 07:28 AM
  2. Counting letters
    By samtwilliams in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-08-2007, 01:05 PM
  3. counting letters
    By Pyrex238 in forum Excel General
    Replies: 5
    Last Post: 05-10-2007, 03:54 PM
  4. Counting Letters
    By Hayeso in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 02:05 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