+ Reply to Thread
Results 1 to 7 of 7

counting range of cells with condition

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    Indiana, U.S.A.
    MS-Off Ver
    Excel 2010
    Posts
    6

    counting range of cells with condition

    are the apostrophe's what is meant by 'tags' when posting code? I want to make sure I submit a request for assistance accurately... But, what I got is, I need to count the number of cells populated across a range, but not the adjacent cell if it's populated... hard to explain.

    so, range of cells: c6, c7, c8, c9, c10, c11, c12, c13, c14
    8 4 8 8 4 8
    would only count as 3, since the adjacent cell has a value in it. Does that make sense? It is to track occurrences regarding absences; the frequency a technician calls in sick.

    Please Login or Register  to view this content.
    Thanks in advance with any assistance you are able to provide
    Last edited by blexor; 03-25-2014 at 03:59 PM. Reason: added 'code' tags

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: counting range of cells with condition

    Tags means the "code" tags (see the pound symbol when you post).

    Now to your question. Your post doesn't line up real well so I can't tell which of your cells have data or not. I guess it doesn't matter because you are only asking to count blanks. Using the range supplied something like this should work

    Please Login or Register  to view this content.
    Last edited by stnkynts; 03-25-2014 at 04:05 PM.

  3. #3
    Registered User
    Join Date
    03-14-2014
    Location
    Indiana, U.S.A.
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: counting range of cells with condition

    thanks for the reply. . . I didn't realize my text 'shifted' when I posted. My technicians get 'occurence rates' if they say, go home sick every Friday for 2 hours. . .2 hours doesn't add up to much, but doing it repeatedly does. If they take 2 days off in a row for being sick, they only get charged with '1' occurence. I hope that helps explain my dilema. There were supposed to be 'blanks' between some of those 'hours' posted in various cells.
    c6, d6, e6, f6, g6, h6, i6, j6, k6, l6, m6, n6
    8, , , 4, 8, , , , 8, 8, 8, That should only count as 3 occurences. realized I ranged the column the first time too, and it should be across row 6 where I'm counting my values.

  4. #4
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: counting range of cells with condition

    If the previous post did not solve your question I would recommend you submit a copy of your workbook so I have a better idea what is occuring.

  5. #5
    Registered User
    Join Date
    03-14-2014
    Location
    Indiana, U.S.A.
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: counting range of cells with condition

    Okay, posting the spreadsheet now.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: counting range of cells with condition

    Try this custom function. There may be another way but this seems to work.

    Please Login or Register  to view this content.
    To use put the formula =CountOccurance(6) in cell NH6. Note that the 6 is for the row number. You will need to put a 7 for row 7, etc
    Last edited by stnkynts; 03-25-2014 at 05:10 PM.

  7. #7
    Registered User
    Join Date
    03-14-2014
    Location
    Indiana, U.S.A.
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: counting range of cells with condition

    Wow, great. I hit the forum up, because the code I was coming up with was going to take up several thousand lines (500 technicians all together). Thanks for your help with this. Saved me a ton of time; really appreciated.

+ 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. counting blank cells in range based on condition using another column
    By TheBlueBell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2013, 04:58 PM
  2. Counting the number of empty cells based on a condition in a range
    By naga in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-01-2013, 10:01 AM
  3. [SOLVED] Counting cells that fall in a date range AND meet a Yes/No condition
    By pentatonic145 in forum Excel General
    Replies: 2
    Last Post: 05-01-2012, 04:26 PM
  4. Replies: 2
    Last Post: 06-19-2006, 09:10 AM
  5. [SOLVED] In excel counting cells in a range which meet condition ">Xand<X"
    By Uncivil Servant in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-19-2006, 09:45 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