+ Reply to Thread
Results 1 to 11 of 11

Formula to count number of cells with specific text and more than 1 condition.

  1. #1
    Registered User
    Join Date
    08-04-2014
    Location
    Chennai
    MS-Off Ver
    MS Office 2010
    Posts
    19

    Formula to count number of cells with specific text and more than 1 condition.

    Hi All,

    I request your kind expertise to find me a solution for a peculiar problem that exists. Basically, I am trying to count number of cells using a formula which contains specific text. Refer attached excel sheet for example. The table contains department, name of employee, the fruits he likes and whether he is active or retired in the organisation. I need to calculate number of employees who are active or retired, within a specific department who likes a particular fruit. The above example is used only for our exercise, whereas the real data has other fields where I need to apply the formula. The real problem is , the data (in this case the fruits) can be more than one but it exists inside one cell which cannot be copied/pasted in different cells as the amount of data is quite large.

    Can anyone please help me with some basic excel function which will return me number of employees in a particular department who like a particular fruit (irrespective of the fact that he may like other fruits as well).
    Attached Files Attached Files

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

    Re: Formula to count number of cells with specific text and more than 1 condition.

    Try COUNTIFS with wildcards, e.g.

    =COUNTIFS(B:B,"Sales",E:E,"Active",D:D,"*Apple*")
    Audere est facere

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: Formula to count number of cells with specific text and more than 1 condition.

    That doesn't work, DDL. It returns 2, not 5.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    08-04-2014
    Location
    Chennai
    MS-Off Ver
    MS Office 2010
    Posts
    19

    Re: Formula to count number of cells with specific text and more than 1 condition.

    Thanks for suggesting but it does not work

  5. #5
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Formula to count number of cells with specific text and more than 1 condition.

    Can you please put expected result into your sample workbook?
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: Formula to count number of cells with specific text and more than 1 condition.

    See cell F2.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,064

    Re: Formula to count number of cells with specific text and more than 1 condition.

    Yes it does. The expected answer is incorrect. Only Bill and Jack are in sales and like apples. But maybe the result the OP expects is given by:

    =COUNTIFS(B:B,B2,E:E,"Active",D:D,"*Apple*")
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  8. #8
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Formula to count number of cells with specific text and more than 1 condition.

    Quote Originally Posted by AliGW View Post
    See cell F2.
    Ali, then Post #2 answer is correct it would be 2 not 5.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: Formula to count number of cells with specific text and more than 1 condition.

    Ooops! I had misread column B. Yes, you are right and the OP's calculation is wrong.

  10. #10
    Registered User
    Join Date
    08-04-2014
    Location
    Chennai
    MS-Off Ver
    MS Office 2010
    Posts
    19

    Re: Formula to count number of cells with specific text and more than 1 condition.

    My apologies everyone if I have confused you with the numbers. I should have specified earlier, it was just for example purpose only. I have now attached the rectified numbers and a sample of expected result which I am trying to generate based on the info.
    Have tried the above formula but it gives error message.
    Attached Files Attached Files
    Last edited by PKRathor; 01-16-2018 at 12:45 AM.

  11. #11
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Formula to count number of cells with specific text and more than 1 condition.

    Try

    B16
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by shukla.ankur281190; 01-16-2018 at 12:53 AM. Reason: Last criteria Active

+ 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] Formula to count number of blank cells for a specific condition in another column
    By Daniel_12 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-30-2013, 07:16 AM
  2. count number of cells with specific text
    By jenn5 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-06-2013, 03:00 PM
  3. [SOLVED] Count the number of cells with specific text
    By excelinexcel7 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 01-22-2013, 10:51 AM
  4. Replies: 8
    Last Post: 07-13-2012, 09:02 AM
  5. Need formula to count specific number of cells
    By FairfaxHS in forum Excel General
    Replies: 2
    Last Post: 05-18-2012, 04:10 PM
  6. Replies: 4
    Last Post: 05-05-2012, 05:01 AM
  7. [SOLVED] how 2 Count number of cells that have specific condition format?
    By daveydavey in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-04-2005, 10:06 AM

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