+ Reply to Thread
Results 1 to 12 of 12

Count number of cells that contain numbers based on another column

  1. #1
    Registered User
    Join Date
    04-02-2015
    Location
    Southampton, England
    MS-Off Ver
    Excel 365
    Posts
    41

    Count number of cells that contain numbers based on another column

    Hi,

    I need help with a formula that can count a range of cells that include figures, based on another column which contains text.

    I have salary information in column C, and i need to calculate headcount based on department name in column B, so I want to add up how many employees salaries relate to department "Delivery"

    e.g. out of 75 staff it should say 20

    Any help would be great, thanks!

  2. #2
    Registered User
    Join Date
    12-18-2012
    Location
    Bellingham, WA
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Count number of cells that contain numbers based on another column

    I don't understand how salary plays into this. Don't you just want to count how many in Column B have the department "Delivery"?

  3. #3
    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: Count number of cells that contain numbers based on another column

    Had you intended to attach a sheet?

    Please attach a sample workbook. Make sure there is enough data to demonstrate your need. Make sure your desired results are shown, mock them up manually if necessary. Remember to remove ALL confidential information first!!!

    However, nothing on this Forum works quite as well as you might expect. The attachment icon doesn't work!! (Helpful, isn't it!!). Instead, just before you submit your post, click on GO ADVANCED (near the bottom) and then scroll down to Manage Attachments to open the upload window. The relevant instructions are at the top of that screen.
    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

  4. #4
    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: Count number of cells that contain numbers based on another column

    or did you simply want:

    =COUNTIF(B:B,"Delivery")

  5. #5
    Registered User
    Join Date
    04-02-2015
    Location
    Southampton, England
    MS-Off Ver
    Excel 365
    Posts
    41

    Re: Count number of cells that contain numbers based on another column

    Sorry, I've attached a sheet now

    Different months have zero values in so I don't want to include them in the monthly total
    Attached Files Attached Files

  6. #6
    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: Count number of cells that contain numbers based on another column

    In C67, copied across and down:
    =COUNTIFS(C$5:C$63,"<>"&0,$B$5:$B$63,$B67)

  7. #7
    Registered User
    Join Date
    04-02-2015
    Location
    Southampton, England
    MS-Off Ver
    Excel 365
    Posts
    41

    Re: Count number of cells that contain numbers based on another column

    Excellent Glenn Excellent!! Thanks.

    What if I wanted to also include another section, so C$5:C$63 and also C$67:C$72, how can I include that?

  8. #8
    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: Count number of cells that contain numbers based on another column

    Once again, can you post a sampel so that can see your data structure?

  9. #9
    Registered User
    Join Date
    04-02-2015
    Location
    Southampton, England
    MS-Off Ver
    Excel 365
    Posts
    41

    Re: Count number of cells that contain numbers based on another column

    Sorry Glenn, here you go
    Attached Files Attached Files

  10. #10
    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: Count number of cells that contain numbers based on another column

    Yea, OK. For a moment I thought that this was going to require a bit of a monster, but no. Just extend the ranges. The subtotals can't affect it as they are not classified as D, WP, etc, in column B.

    =COUNTIFS($B$5:$B$72,$B75,C$5:C$72,"<>0")

    will work perfectly, copied across and down.

  11. #11
    Registered User
    Join Date
    04-02-2015
    Location
    Southampton, England
    MS-Off Ver
    Excel 365
    Posts
    41

    Re: Count number of cells that contain numbers based on another column

    That's excellent, thanks so much Glenn!

  12. #12
    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: Count number of cells that contain numbers based on another column

    You're very welcome.
    Last edited by Glenn Kennedy; 09-08-2016 at 07:33 AM.

+ 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. Replies: 3
    Last Post: 08-01-2016, 10:31 AM
  2. Count number of clusters of numbers within a column of numbers
    By SEABOND in forum Hello..Introduce yourself
    Replies: 3
    Last Post: 08-01-2016, 09:34 AM
  3. Replies: 3
    Last Post: 06-26-2015, 12:50 PM
  4. [SOLVED] Count the number of unigue numbers based on number in another column.
    By ksmith4809 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-27-2013, 09:11 AM
  5. Replies: 6
    Last Post: 11-18-2012, 09:15 AM
  6. Replies: 9
    Last Post: 06-08-2012, 06:22 PM
  7. Count the number of unique Numbers in a column
    By ajajmannen in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 05-10-2006, 01:10 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