+ Reply to Thread
Results 1 to 16 of 16

Countif

Hybrid View

  1. #1
    Registered User
    Join Date
    12-16-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    7

    Countif

    Hi guys,

    I'm using excel 2010 and have run into an issue on one of my spreadsheets. Currently I'm using a countif function to count all letter 'Y's as 1 and I need to add in so I can count another letter as 0.5. Does anyone know what formula I can add it?

    The current formula I'm using is =COUNTIF(I16:I33, "*Y*")

    Thanks

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,586

    Re: Countif

    COUNTIFS, perhaps?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,300

    Re: Countif

    Hi Matthew and welcome to the forum,

    Perhaps

    =COUNTIF(I16:I33, "*Y*") + COUNTIF(I16:I33, "*A*")/2
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    12-16-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    7

    Re: Countif

    Thank you MarvinP you're a lifesaver!

  5. #5
    Registered User
    Join Date
    12-16-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    7

    Re: Countif

    I have one more question for you please

    I'm using the formula =COUNTIF(H16:H278, "*") to count cells that contain text, but I need to count certain cells as 0.5 in the same range, is there a way I can do that?

  6. #6
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Countif

    Try the following, replace the letter "A" with text that you want to count as 0.5 in the same range:

    =COUNTIF(H16:H278,"*")-COUNTIF(H16:H278,"*A*")+COUNTIF(H16:H278,"*A*")/2

  7. #7
    Registered User
    Join Date
    12-16-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    7

    Re: Countif

    It's going out as =COUNTIF(H16:H278, "*")-COUNTIF(H16:H278,"*A*"+COUNTIF(H16:H278,"*A*"/2))

    I'm replacing "A" with a name does that matter? And it is still picking it up as 1 not 0.5

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,940

    Re: Countif

    attach a sample with desired result
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  9. #9
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Countif

    Can you post an example file with an expected outcome in excel format please? Use the below URL for help on how to upload a file.

    http://www.excelforum.com/members/da...ch-a-file.html

  10. #10
    Registered User
    Join Date
    12-16-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    7

    Re: Countif

    =COUNTIF(H16:H278,"*")-COUNTIF(H16:H278,"*stephen mcgowan*"+COUNTIF(H16:H278,"*stephen mcgowan*"/2))

    I'm working with a column of different names and sometimes there will be the same name in 2 different cells. If there are 2 of same name in the column I need them to add up as 0.5 and single names to add up as 1

  11. #11
    Registered User
    Join Date
    12-16-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    7

    Re: Countif

    I have attached a sample.

    In the candidate column If there is a double up of candidates, I need them to equal 1 not 2

  12. #12
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Countif

    Hi,

    Try the following formula to obtain a count of unique candidates list.

    =SUMPRODUCT((H16:H278<>"")/COUNTIF(H16:H278,H16:H278&""))

    See the attached file, I have updated the formula in H9.
    Attached Files Attached Files

  13. #13
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,300

    Re: Countif

    I don't understand your additional question. Could it be you need one of the other Count functions? See:

    http://www.exceltip.com/tips/excel-2...ountblank.html

  14. #14
    Registered User
    Join Date
    12-16-2015
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    7

    Re: Countif

    I don't think I explained it well haha.

    If I have a column of candidate names and the formula is =COUNTIF(H16:H278,"*") counting text in each cell as 1, so 5 names equals 5. If the same name comes up twice, is there a way that I can write a formula so that a double up of a name equal 1 not 2?

  15. #15
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Countif

    Quote Originally Posted by Matthewcooney View Post
    I don't think I explained it well haha.

    If I have a column of candidate names and the formula is =COUNTIF(H16:H278,"*") counting text in each cell as 1, so 5 names equals 5. If the same name comes up twice, is there a way that I can write a formula so that a double up of a name equal 1 not 2?
    Did you try the formula I suggested in Post #12?

  16. #16
    Forum Contributor Immortal2014's Avatar
    Join Date
    09-18-2014
    Location
    Greece (EU)
    MS-Off Ver
    Office 2021
    Posts
    405

    Re: Countif

    From A1 to A5 name Matthewcooney is in cell A2 and again in cell A5. The other three cells of range contains different names. Then count names and get the result, 4 different names in range A1:A5. Is that you want?

+ 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. Faster if/countif formula for flagging uniques - countif too slow
    By Speshul in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-19-2015, 01:44 PM
  2. [SOLVED] Countif within a Countif - Countception
    By stiganovski in forum Excel General
    Replies: 3
    Last Post: 04-26-2012, 12:47 PM
  3. [SOLVED] =Subtotal(countif,Range); Subtotal and countif in 1 formula [SOLVED]
    By thomas.mapua in forum Excel General
    Replies: 5
    Last Post: 01-06-2012, 11:33 AM
  4. Combining a Date Range COUNTIF and a general COUNTIF
    By jacobtom in forum Excel General
    Replies: 1
    Last Post: 09-15-2011, 05:06 PM
  5. Adding a CountIF to a formula that is already Countif
    By Cmorgan in forum Excel General
    Replies: 4
    Last Post: 06-01-2011, 09:34 AM
  6. [SOLVED] COUNTIF or not to COUNTIF on a range in another sheet
    By Ellie in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-15-2005, 05:06 PM
  7. Countif w/ Multiple Criteria-How do I use countif
    By Patrick_KC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-09-2005, 05:05 PM

Tags for this Thread

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