+ Reply to Thread
Results 1 to 12 of 12

Counting Upper case P as 1 and lower case p as 0.5

  1. #1
    Registered User
    Join Date
    12-04-2006
    Location
    St. Louis
    Posts
    17

    Counting Upper case P as 1 and lower case p as 0.5

    How can I count an upper case "P" as a 1.0 and a lower case "p" as 0.5 in the same row. I'm using =CountIF and body have a formula for me to try.

    Thanks for you help.
    Greg
    Thanks,
    Greg

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting Upper case P as 1 and lower case p as 0.5

    Hi,

    This array formula is one way of counting the number of upper case Ps in a range. Enter it with Ctrl-Shift-Enter

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


    replace the 80 with 112 for lower case p.

    Not sure whether having found the numbers you want to do something else like perhaps multiply the count by 1 in the case of P and 0.5 if p. In which case just add *1 or *.5
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-04-2006
    Location
    St. Louis
    Posts
    17

    Re: Counting Upper case P as 1 and lower case p as 0.5

    Yes want to count the Upper case Ps and Lower case p's and add them together.

  4. #4
    Forum Contributor
    Join Date
    12-09-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    171

    Re: Counting Upper case P as 1 and lower case p as 0.5

    Hi,

    Try this array formula...

    Please Login or Register  to view this content.
    As Richard said, Enter it with Ctrl-Shift-Enter
    Like my answer, then click * below

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting Upper case P as 1 and lower case p as 0.5

    In that case use the formulae I gave you and add them after multiplying each one by its relevant factor.

  6. #6
    Registered User
    Join Date
    12-04-2006
    Location
    St. Louis
    Posts
    17

    Re: Counting Upper case P as 1 and lower case p as 0.5

    Sorry guys I'm not getting it. I have attached an example of the data and formula below with my cell range.

    =(SUM(--IF(I82:JJ82<>"",CODE(I82:JJ82)=112,0))/2)+(SUM(--IF(I82:JJ82<>"",CODE(I82:JJ82)=80,0)))
    Attached Images Attached Images

  7. #7
    Forum Contributor
    Join Date
    12-09-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    171

    Re: Counting Upper case P as 1 and lower case p as 0.5

    Once you enter the formula, you need to press Ctrl+Shift+Enter, then you will get the result.

    If you already enter then press F2 then press Ctrl+Shift+Enter

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,496

    Re: Counting Upper case P as 1 and lower case p as 0.5

    Why didn't we use FIND for upper and lower case:

    =SUMPRODUCT(NOT(ISERROR(FIND("P",$I$82:$JJ$82)))+NOT(ISERROR(FIND("p",$I$82:$JJ$82)))/2)

    Enter only.
    Quang PT

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Counting Upper case P as 1 and lower case p as 0.5

    Quote Originally Posted by bebo021999 View Post
    Why didn't we use FIND for upper and lower case:
    No particular reason. That's the beauty of Excel. There are often several ways of achieving the same result

  10. #10
    Registered User
    Join Date
    12-04-2006
    Location
    St. Louis
    Posts
    17

    Re: Counting Upper case P as 1 and lower case p as 0.5

    Wow that is a beautiful formula! Works perfectly! Exactly what I needed.

    Thank you!
    Greg

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Counting Upper case P as 1 and lower case p as 0.5

    For exact case matches perhaps use EXACT function, e.g. this formula should give the same result. The first part counts all "P"s and the EXACT part adds another 1/2 for each upper case "P"

    =SUMPRODUCT((I82:JJ82="P")+EXACT(I82:JJ82,"P"))/2
    Audere est facere

  12. #12
    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 Upper case P as 1 and lower case p as 0.5

    Nice, DLL.
    Entia non sunt multiplicanda sine necessitate

+ 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. Delete duplicates with lower case and upper case taken into account?
    By Tinwelende in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-17-2013, 11:35 AM
  2. [SOLVED] Convert 1st letter of word to Upper Case and rest to lower case
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-23-2013, 11:44 AM
  3. distinguishing upper and lower case when counting
    By JHWEH in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-10-2008, 04:07 AM
  4. Replies: 2
    Last Post: 12-09-2005, 05:15 AM
  5. Replies: 14
    Last Post: 08-25-2005, 10: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