+ Reply to Thread
Results 1 to 16 of 16

Counting cells because of 4 same letters in the cell

  1. #1
    Registered User
    Join Date
    12-17-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Counting cells because of 4 same letters in the cell

    Hey Guys,

    I got a tricky problem which I cannot solve by myself. I got a table with entries in rows which start with 4 letters. The numbers of rows starting with the same letters varies. I need to know how much rows start with the same 4 letters. A my table contains over 500 rows it would be very handy if excel did it automatically. In my table the letters do not follow any logical algorythm - they are abbreviations.
    WXYZ001 1 0 4
    WXYZ002 2 6 0
    ABCD001 1 1 0
    ABCD002 2 5 2
    ABCD003 4 5 7
    ABCD004 2 3 5
    ABCD005 3 4 6
    HIJK001 1 2 5

    This is what I would like to see:
    WXYZ 2
    ABCD 5
    HIJK 1

    Thanks in advance,
    Greetings

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Counting cells because of 4 same letters in the cell

    =countif(A1:A8, "WXYZ*")
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting cells because of 4 same letters in the cell

    Try this...

    Data Range
    A
    B
    C
    D
    1
    WXYZ001
    1
    0
    4
    2
    WXYZ002
    2
    6
    0
    3
    ABCD001
    1
    1
    0
    4
    ABCD002
    2
    5
    2
    5
    ABCD003
    4
    5
    7
    6
    ABCD004
    2
    3
    5
    7
    ABCD005
    3
    4
    6
    8
    HIJK001
    1
    2
    5
    9
    ------
    ------
    ------
    ------
    10
    11
    WXYZ
    2
    12
    ABCD
    5
    13
    HIJK
    1


    This formula enetered in B11 and copied down:

    =COUNTIF(A$1:A$8,A11&"*")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    12-17-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Re: Counting cells because of 4 same letters in the cell

    Thank you for your quick replies!
    Solution 1 gives me the right number for WXYZ but how do I get the others?
    Solution 2 counts ever row - do I miss something? I use =COUNTIF(B$22:B$598,B602&"*") A in the Example is B in my real dataset.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Counting cells because of 4 same letters in the cell

    Tony's formula is the same as mine with the prefix stuck in another cell.

    If you can't adapt it, post a workbook.
    Last edited by shg; 08-25-2015 at 10:56 AM.

  6. #6
    Registered User
    Join Date
    12-17-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Re: Counting cells because of 4 same letters in the cell

    Alright thanks for your offer - here is the workbook (only relevant cases)
    countif problem.xlsx

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting cells because of 4 same letters in the cell

    So what problem are you having?

    The formula works OK when I try it.

    Data Range
    A
    B
    C
    D
    1
    BREN001
    BREN
    2
    2
    BREN002
    SCOL
    15
    3
    SCOL001
    PLAT
    1
    4
    SCOL003
    ------
    ------
    ------
    5
    SCOL004
    6
    SCOL005
    7
    SCOL006
    8
    SCOL008
    9
    SCOL009
    10
    SCOL010
    11
    SCOL011
    12
    SCOL012
    13
    SCOL013
    14
    SCOL014
    15
    SCOL015
    16
    SCOL016
    17
    SCOL017
    18
    PLAT001


    This formula entered in D1 and copied down:

    =COUNTIF(A:A,C1&"*")

  8. #8
    Registered User
    Join Date
    12-17-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Re: Counting cells because of 4 same letters in the cell

    Crazy but this sam formula pasted in cell D1 generates the numer 577 same when copying down + the 4 letters do not appear in column C.
    Only difference to your formula is that I translate it as my Excel does not like english functions. Still the synthax should stay the same.
    Anyway thanks for your efforts!

  9. #9
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Counting cells because of 4 same letters in the cell

    What precisely did you enter into cell C1 to give the result of 577?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  10. #10
    Registered User
    Join Date
    12-17-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Re: Counting cells because of 4 same letters in the cell

    This is what I entered
    =ZÄHLENWENN(A:A;C1&"*")
    "Zählenwenn" is COUNTIF in German (by the way I would prefer using the english formula ) inside the brackets I had to change the , to a ; otherwise it does not accept the formula

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting cells because of 4 same letters in the cell



    Is calculation set to automatic?

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting cells because of 4 same letters in the cell

    Quote Originally Posted by dontbugme1 View Post
    + the 4 letters do not appear in column C.
    You have to enter them yourself.

    One way to get Excel to do it is to use advanced filter on unique entries:

    http://contextures.com/xladvfilter01.html#FilterUR

  13. #13
    Registered User
    Join Date
    12-17-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Re: Counting cells because of 4 same letters in the cell

    Ok for the letters - i thought it would happen automatically (somehow...)
    What do you mean by calculation set to automatic?

  14. #14
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Counting cells because of 4 same letters in the cell

    You didn't enter anything into cell C1??

    But of course the answer will be 577, since, by not entering a criterion into that cell, you are effectively instructing Excel to count all non-blank text entries of any description.

    Regards

  15. #15
    Registered User
    Join Date
    12-17-2014
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    19

    Re: Counting cells because of 4 same letters in the cell

    Ok, now I understand the Synthax!!!
    Thanks to you all and sorry for my noobness!
    Now it works!

  16. #16
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting cells because of 4 same letters in the cell

    Good deal. Thanks for the feedback!

+ 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: 8
    Last Post: 07-23-2014, 09:12 AM
  2. Counting letters when corresponding cell isn't empty
    By Rich18 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-02-2013, 09:54 AM
  3. [SOLVED] Counting Alphabetic Letters alone inside the Cell excluding spaces
    By thilag in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-05-2013, 01:59 PM
  4. [SOLVED] Help Counting Cells w/first 3 letters...
    By CRichardsDSX in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-31-2012, 09:47 AM
  5. Counting the number of letters in a cell
    By beefycj5 in forum Excel General
    Replies: 3
    Last Post: 11-19-2012, 06:31 AM
  6. Replies: 9
    Last Post: 07-15-2010, 08:54 PM
  7. Populate cell with letters from other cells
    By ERudy in forum Excel General
    Replies: 3
    Last Post: 05-16-2006, 12:15 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