+ Reply to Thread
Results 1 to 13 of 13

Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

  1. #1
    Registered User
    Join Date
    04-02-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    I am trying to set up a worksheet that shows shifts using a Capital "D" and a lower case "d" (one is for a 12 hour shift, the other for only 6 hours). Is there any way to set up a Countif formula that makes the distinction? Thank you in advance for your consideration.
    Last edited by neetal; 06-27-2014 at 09:11 AM. Reason: adding tags

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    Unfortunately, countif is not case sensitive.

    You could use sumproduct with the exact function..

    =SUMPRODUCT(--(EXACT(A1:A100,"D")))
    and
    =SUMPRODUCT(--(EXACT(A1:A100,"d")))

  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: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    Try this...

    Data Range
    A
    B
    C
    D
    1
    -----
    -----
    -----
    -----
    2
    D
    D
    5
    3
    D
    d
    4
    4
    d
    5
    d
    6
    d
    7
    D
    8
    d
    9
    D
    10
    D


    This formula entered in D2 and copied down:

    =SUMPRODUCT(--(EXACT(A$2:A$10,C2)))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    Use Exact() with Sumproduct() combination


    In A1 to A5

    d
    D
    d
    D
    D

    =SUMPRODUCT(--EXACT(A1:A5,"d"))

    Or

    =SUMPRODUCT(--EXACT(A1:A5,"D"))


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    hey bro,

    use this array formula....

    {=Count(if(A1:A10="D",Row(A1:A10)))}

    for counting "d"
    just replace it with "d"

    For this formula you have to write..
    =Count(if(A1:A10="D",Row(A1:A10)))

    Then press control+ shift+ enter...

    For any explanation.. just make a post..


    If the suggestion helps you, then Click *below to Add Reputation

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

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    Quote Originally Posted by Vikas_Gautam View Post
    hey bro,

    use this array formula....

    {=Count(if(A1:A10="D",Row(A1:A10)))}

    for counting "d"
    just replace it with "d"
    That won't work. The IF function doesn't differentiate text case. In the IF function D and d are the same.

  7. #7
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    Quote Originally Posted by Vikas_Gautam View Post
    use this array formula....

    {=Count(if(A1:A10="D",Row(A1:A10)))}
    Logical Part of If is not Case Sensitive, so it won't work

  8. #8
    Registered User
    Join Date
    04-02-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    Absolutely perfect! Thank you SO much! Never occurred to me that I could use SUMPRODUCT instead of COUNTIF. Thank you SO much for a perfect reply in such a speedy timeframe. You Rock!!!

  9. #9
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    You're welcome.

  10. #10
    Registered User
    Join Date
    04-02-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    Absolutely perfect! Thank you SO much! Never occurred to me that I could use SUMPRODUCT instead of COUNTIF. Thank you SO much for a perfect reply in such a speedy timeframe. You Rock!!!

  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: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.


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

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    A fight between SUMPRODUCT and COUNTIF would be a tough one to call...
    Click * below if this answer helped

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

  13. #13
    Registered User
    Join Date
    04-02-2014
    Location
    Colorado
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Using Countif to count only Capital Leter (i.e. D) and lower case (i.e. d)

    Thank you SO much for letting me know about the "solved" tool. As you can no doubt tell, I'm a newbie to this forum. Again, thank you so much for all your help!

+ 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] Can excel distinguish capital vs. lower case?
    By steveseer in forum Excel General
    Replies: 4
    Last Post: 07-17-2013, 01:40 PM
  2. Sort capital letters before lower case?
    By Tinwelende in forum Excel General
    Replies: 42
    Last Post: 06-17-2013, 03:58 PM
  3. Highlighting lower case in cells and ALL CAPITAL CASE
    By NJS1982 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2013, 07:47 AM
  4. how to change Lower case to capital case in same cell
    By sellva2205 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2012, 11:52 AM
  5. making lower case letters capital
    By hollandrob81 in forum Excel General
    Replies: 2
    Last Post: 11-12-2008, 09:12 AM

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