+ Reply to Thread
Results 1 to 8 of 8

Counting empty cells between two cells with data in them.

  1. #1
    Registered User
    Join Date
    10-06-2012
    Location
    Dartmouth
    MS-Off Ver
    Excel 2010
    Posts
    9

    Counting empty cells between two cells with data in them.

    Hi folks, I have a sheet where column c contains an employee's name and data is in columns d-j. There are a variable number of rows between employees where there is data in rows d-j but not in row c. Is there a way to count the number of rows between the employees? I am trying to build a formula to extract data for each employee based on customer interactions. Only some of the rows meet the criteria I am looking for.

    employee 1 total amount
    case 1 case1.1
    case 2 case 2,2
    employee 2 total amount
    case 1 case1.1
    case 2 case 2,2
    case 3 case3.1
    case 4 case 4,2
    employee 3 total amount
    case 1 case1.1
    case 2 case 2,2

    Case 1 for employee one meets criteria and case 3 for employee 2 and case 2 for employee three. Just wondering how to count the number of rows between employees using either a formula or vba.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Counting empty cells between two cells with data in them.

    You can see that formatting on these posts is terrible, so it is not clear how your data is laid out - please attach a sample Excel workbook instead (the FAQ describes how to).

    Pete

  3. #3
    Registered User
    Join Date
    10-06-2012
    Location
    Dartmouth
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Counting empty cells between two cells with data in them.

    Here is the sample, I removed the identifiable data name 1 and name 2 are the employees and the records in between contain the data I am working with.
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Counting empty cells between two cells with data in them.

    So, with reference to this file, can you explain more clearly what you want to achieve. You seem to have changed a few things compared to your first post (name is in column A, for example, not C, no data in columns I and J).

    Pete

  5. #5
    Registered User
    Join Date
    10-06-2012
    Location
    Dartmouth
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Counting empty cells between two cells with data in them.

    Sorry I copied from a business spread sheet to protect the information. I want to count the number of rows dynamically between employee names so I can create a formula that allows me to extract data about the employees interactions. The number of transactions vary between employees. The spreadsheet is a report on fee transactions. The criteria used to create the spreadsheet is not accurate and I have to produce a report to show whether it is an employee error or a report error and then take appropriate action - touch base with the employee to enhance training or report to the boss the accurate rate of collection.

    I want to count blank cells and reset the count to zero when I hit a cell with an employee's name in it. I have written this =IF(C6=ISTEXT(C6),ROWS(C6:C6),0) which gives me a score of one for each row of data for an employee. I want to write something that stops when it hits the the next zero and gives me a row count so I can return the multiple data I am looking for based on critera maybe through vlookup. I can't fix the start row as $c$6 as the next employee is at c31 and need to restart there with the next employee at c38 This is in the real spread sheet, in the example it would be a1,a25, and a32.

    As you can tell I am knowledgeable enough to be dangerous but not solve the problem.
    Last edited by Dartmouth_jock; 01-07-2016 at 07:12 PM.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Counting empty cells between two cells with data in them.

    I'm still not sure what you want to achieve. Referring to your example file, might it be that in cell I3 (same row as name1 appears) you want the number 25, which is the number of rows of data associated with that name, and that in cell I28 you would want 7, which is the number of rows for that name (before the end of your table)?

    Should I insert two new columns A and B into the file you submitted to make it of the same layout of your real data, or will you submit a more representative example file?

    Pete

  7. #7
    Registered User
    Join Date
    10-06-2012
    Location
    Dartmouth
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Counting empty cells between two cells with data in them.

    Hi Pete, thanks for taking the time and having patience with me. What I am trying to do is write something that will count the number of entries for an agent and allow me to extract specific data. The search has to stop at the next agent and start again. I have created a formula that counts the number of entries per agent and resets the count to zero for the next agent but I cant figure out how to use that information to start the search at cell containing zero for the next agent. This is the layout for the spreadsheet I receive.

    Thanks again
    Attached Files Attached Files

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Counting empty cells between two cells with data in them.

    Would it not be easier to fill column C (in your latest file) with the name of each agent?

    This can be done quite easily (and quickly) by selecting all the cells in the table for that column (i.e. from C2 to C13 in the example file), and then pressing F5 (GoTo), then clicking on Special... and clicking against Blanks and clicking OK. (So now only the blanks in that column will be selected, starting with cell C3). Then you type = and click on the cell immediately above the active cell, and then CTRL-Enter together, and that will replicate that formula into all the blank cells, giving you the name of each agent in every cell.

    I'm not sure what you want to do beyond that, but you can easily use a SUMIF formula (or COUNTIF) to get a total (or count) of all the entries for each agent.

    Hope this helps.

    Pete

+ 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 Empty Cells Between Two Values
    By billykiller05 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-26-2014, 08:10 PM
  2. Counting empty cells
    By Cunner in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-28-2013, 05:52 AM
  3. [SOLVED] counting empty cells in a row before first data entry
    By bonviveur60 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-27-2012, 08:21 PM
  4. counting empty cells
    By Davycc in forum Excel General
    Replies: 5
    Last Post: 04-07-2011, 12:00 PM
  5. Counting number of cells that are not empty
    By st_judeu@yahoo.com in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-29-2010, 12:04 PM
  6. Counting non-empty cells
    By Phosphonothioic in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2009, 03:42 AM
  7. Problem counting empty cells
    By Crovean in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-02-2007, 11:50 AM
  8. [SOLVED] Counting empty cells within a range of cells
    By Rosehill - ExcelForums.com in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-02-2005, 04:06 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