+ Reply to Thread
Results 1 to 22 of 22

Counting Cells with Particular Character or String value

  1. #1
    Registered User
    Join Date
    12-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    13

    Counting Cells with Particular Character or String value

    Hi Team,

    I have a data and trying to Count of the Vehicles for all the Drivers whose Name starts with ‘R’.
    Anyhelp will be appriciated

    Thanks
    Anir
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Counting Cells with Particular Character or String value

    See attached, I added column H (you can hide) and formula Count.if at the bottom of column C
    Attached Files Attached Files
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Counting Cells with Particular Character or String value

    Hello anir_sarkar1,

    Do you mean something like this?

    Also see the "Please consider" note at the bottom of this post.
    Attached Files Attached Files
    Last edited by Winon; 12-31-2012 at 05:58 AM. Reason: Used wrong formula
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Counting Cells with Particular Character or String value

    Maybe.

    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

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

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Registered User
    Join Date
    12-21-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Counting Cells with Particular Character or String value

    Hi anir
    Please try below code and let know if that works for you.
    Please Login or Register  to view this content.
    Hope this helps.
    Kiran

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Counting Cells with Particular Character or String value

    Just to explain that my "code" is a record of a simple formula.

    =COUNTIF(C2:C100,"R*")

  7. #7
    Registered User
    Join Date
    12-21-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Counting Cells with Particular Character or String value

    Agree with you Fotis

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Counting Cells with Particular Character or String value

    Try this where J2 contains the leading letter you want to count.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    [EDIT]
    Good point Fotis, I've got SUMPRODUCT on the brain just now!

    Use this in this example workbook
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Marcol; 12-31-2012 at 06:34 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Counting Cells with Particular Character or String value

    @ Fotis,

    Nice one.

    I have used it without code as per the attached revised WorkBook.
    Attached Files Attached Files

  10. #10
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Counting Cells with Particular Character or String value

    @ Marcol. @ Winon.

    Thanks quys.

    Happy New Year for you and your Families.

    Edit: @ Kiran.Sunkara

    Apologize. I haven;t see your post. Thank you too!
    Last edited by Fotis1991; 12-31-2012 at 07:19 AM. Reason: Edit.

  11. #11
    Registered User
    Join Date
    12-21-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    69

    Re: Counting Cells with Particular Character or String value

    Happy New Year to all!
    Hoping for a enriching, challenging and good learning experience/journey in 2013.

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Counting Cells with Particular Character or String value

    Happy New Year to everyone and their Families.

  13. #13
    Registered User
    Join Date
    12-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Counting Cells with Particular Character or String value

    Quote Originally Posted by Winon View Post
    Happy New Year to everyone and their Families.
    hi friends

    thanks 4 ur help
    I had a death in family so couldn't get time.I'll check all your sugestions once i'll reach home and will get back to you

    happy new year again

    thanks

  14. #14
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Counting Cells with Particular Character or String value

    Hello anir_sarkar1,

    My sincerest condolences with the loss to you and your Family.

    I have revised the Workbook to this.

    Also see the "Please consider" note at the bottom of this post.
    Attached Files Attached Files

  15. #15
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Counting Cells with Particular Character or String value

    Quote Originally Posted by Winon View Post
    Hello anir_sarkar1,

    My sincerest condolences with the loss to you and your Family.

    I have revised the Workbook to this.

    Also see the "Please consider" note at the bottom of this post.
    My sympathies also Anir.

    @ Winon
    If you want to work with whole columns, then you might want to consider using Dynamic Names.
    See the Name Manager to see how.

    This will simplify your formula, and work as the Table/list grows/shrinks.
    Note the C/F for Column C.

    Another option might be to create a list of unique Driver Names (see the formula in Column P)
    Then use that, again as a dynamic name, for the data validation in 'Raw_Data (2)'!H2
    Attached Files Attached Files

  16. #16
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Counting Cells with Particular Character or String value

    @ Marcol,

    ...you might want to consider using Dynamic Names.
    See the Name Manager to see how.
    Thank you Marcol, but I do know that stuff.

    The C/F for Column C is absolutely FANTASTIC!

    Another option might be to create a list of unique Driver Names (see the formula in Column P)
    Then use that, again as a dynamic name, for the data validation in 'Raw_Data (2)'!H2
    The formula in Column P assumes no empty Rows between the Data in the Column.

    Yes, Named Ranges can simplify formulas, but then I would prefer to use it in conjuction with VBA.

    Thank you for all your input, I really appreciate it.

    This is how I have now updated the WorkBook, without Named Ranges.
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    12-23-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Counting Cells with Particular Character or String value

    Thanks All For your help and efforts :-)

    Actually what I was looking for is something different

    Lets see.. In the given file we have 2 Drivers whose name starts with the 'R'
    So the output I was looking for is for both the Drivers

    Ramesh = 17
    Rohit = 12

    Thanks
    Anir

  18. #18
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Counting Cells with Particular Character or String value

    Okay try this workbook

    Enter the first letter, or first few letters, of the drivers' name in cell $I$1

    [EDIT]
    Corrected error in dynamic name "Driver_Name"
    Attached Files Attached Files
    Last edited by Marcol; 01-13-2013 at 10:26 AM. Reason: Improved workbook to allow initial multi-letter selection

  19. #19
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Counting Cells with Particular Character or String value

    Hello anir_sarkar1,

    Don't you think Marcol has done a wonderfull job?

    Now, if we step up the the WorkBook from .xls to .xlsm, we could have it as per the attached sample.

    Also see the "Please consider" note at the bottom of this post.
    Attached Files Attached Files

  20. #20
    Registered User
    Join Date
    12-24-2012
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    33

    Re: Counting Cells with Particular Character or String value

    Winon,

    Just wondering - why would you save your excel files as macro-enabled files when they don't contain macros? Wouldn't xlsx be the correct format.

  21. #21
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Counting Cells with Particular Character or String value

    Hi crakter,

    Yeah, good comment, you are right, .xlsx would do just as well.

    The point I was trying to make is to use Excel > than 2003.

  22. #22
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Counting Cells with Particular Character or String value

    Hello anir_sarkar1,

    Thank you for the Rep.

+ 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