+ Reply to Thread
Results 1 to 5 of 5

Double counting based on COUNTIFS with OR statement

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    59

    Exclamation Double counting based on COUNTIFS with OR statement

    Hello people:

    I have been using this formula to count agents based on time frames which includes OR function: Example:

    =IF(COUNTIFS(AR:AR,"<="&TIME(8,0,0),AO:AO,$AO$2:$AO$10) + COUNTIFS(AQ:AQ,"<="&TIME(8,0,0),AR:AR,"online",AO:AO,$AO$2:AO$10),"1","0")

    (AO Column) includes the agents that have Logged Out at specific Times (Column AR) or if Agents are "Online" (not logged out) (Column AR) as well .

    AO2 is where first agent is listed , although it is not necessary to have each agent's name on time frame count. The most important result is to have a general count of agents for each time frame.

    It works for each row, it gives "1" value if countifs operations results positive for at least 1 of the variables, either logged in or logged at specific time frame.

    The only issue I have not been able to figure out is how to tell Excel not to duplicate agents names for each time frame, in example formula all agents are listed on column AO:AO, and for example if Agent X is listed 10 times on such time frame, then excel counts Agent "Paul" 10 times on rows with a 1, that would mean agent was working on such time frame.

    That is fine but I would like to know if Excel can interpret that there is only 1 Agent named Paul for each time frame.

    Is there a way to avoid multiple counting for each agent?

    Thanks very much!!
    Attached Files Attached Files
    Last edited by figo12; 11-10-2013 at 05:26 PM.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Double counting based on COUNTIFS with OR statement

    Post a sample worksheet or some sample data.
    Gary's Student

  3. #3
    Registered User
    Join Date
    04-09-2013
    Location
    Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Double counting based on COUNTIFS with OR statement

    Quote Originally Posted by Jakobshavn View Post
    Post a sample worksheet or some sample data.
    Jakobshavn thanks, I have made some progress but I do not see the option to attach a file not sure why! Here is the updated formula:

    =IF(COUNTIFS(AR:AR,"<="&TIME(8,0,0),AO:AO,$AO$2:$AO$10) + COUNTIFS(AQ:AQ,"<="&TIME(8,0,0),AR:AR,"online",AO:AO,$AO$2:AO$10),"1","0")

    It works for each row, it gives "1" value if countif operation results positive for at least 1 of the variables, either logged in or logged at specific time frame.

    The only issue I have not been able to figure out is how to tell Excel not to duplicate agents names for each time frame, in example formula all agents are listed on column AO:AO, and for example if Agent X is listed 10 times on such time frame, then excel counts Agent "Paul" 10 times on rows with a 1, that would mean agent was working on such time frame.

    That is fine but I would like to know if Excel can interpret that there is only 1 Agent named Paul for each time frame.

    The real purpose is to just count how many agents worked during a specific time frame (that met either 1 of the countifs criterias)

    Thanks very much!!

  4. #4
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Double counting based on COUNTIFS with OR statement

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    04-09-2013
    Location
    Costa Rica
    MS-Off Ver
    Excel 2010
    Posts
    59

    Re: Double counting based on COUNTIFS with OR statement

    Quote Originally Posted by martindwilson View Post
    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Thanks for your help as well, attached is the sample worksheet. Thanks for the instructions!

    The important thing here is to count the total agents that worked on a time frame, without duplicating agents due that sometimes they log multiple times during time frames. It is not necessary to least all agent names, but that is the only way I have been able to make some progress
    Attached Files Attached Files
    Last edited by figo12; 11-10-2013 at 12:25 PM.

+ 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. COUNTIFS not counting all numbers in one cell
    By taichi56 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-16-2013, 05:46 PM
  2. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  3. Countifs not counting, returns #value
    By Qualo_Jinn in forum Excel General
    Replies: 3
    Last Post: 12-09-2011, 04:13 PM
  4. Countifs Statement
    By turpink in forum Excel General
    Replies: 1
    Last Post: 09-12-2011, 01:01 PM
  5. Too long countifs statement
    By kcasey1318 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-06-2010, 10:39 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