+ Reply to Thread
Results 1 to 17 of 17

Counting if in certain cohort

  1. #1
    Registered User
    Join Date
    03-05-2014
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    15

    Counting if in certain cohort

    Hi all,
    Just the noob again. I have a spreadsheet (which I cant upload from my place of work) which I need some help with. There are 2 pages, one for tracking and another for performance. I am trying to get some information to pull across from the tracking sheet to the performance sheet, and counting how many there are if 2 things are met.
    In column E there is a 13 week date which is auto populated depending on the date in column D. Column G works out which cohort period the date in column E falls into from a hidden table. Column H is an end date and then column F shows TRUE or FALSE if the end date is prior to the date in column E. (So sorry if this is already confusing some).
    Now what I need on the performance sheet is it to total the number within each cohort but only if the F column shows true.
    For instance - There are 4 in May 14 cohort, 3 have met (TRUE) 1 hasnt (FALSE). There are also 4 in June 14 cohort, 1 has met (TRUE) and 3 havent (FALSE). But i only need it to count the 3 TRUE statements from the May cohort, then the June ones will show in the row below.

    If you need anymore information I am happy to supply it. But like I say I cant upload the sheet and I know this would be easier.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,119

    Re: Counting if in certain cohort

    you could use a countif() or countifs()

    do you have cohort group in the performance sheet ?
    so

    countifs( cohort group range, cohort criteria in perf sheet, column F, TRUE)
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    03-05-2014
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counting if in certain cohort

    What I have in the performance sheet is a table where I want the information to go, so a row for mar 14, apr 14, may 14 etc. In the performance sheet I then have a list where user can select which month they want to look at and it will pull information across to a visible table (the table where all the information is will be hidden and locked so user error/adjustment can not interfere with the results). Will this still work?

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,119

    Re: Counting if in certain cohort

    Yes, it works with hidden columns and hidden sheets

    Are the dates set out as 1/3/14 and formatted to show MMM YY
    or are they text with MAR 14

    really depends on the actual data , how/if the count will work OK

    so something like
    COUNTIF(A1:A100,MONTH(A1:A100)=11)
    to count the month

    or you may need to use
    =COUNTIF(A1:A100,">="&DATE(2014,3,1))-COUNTIF(A1:A100,">"&DATE(2014,3,31))

    Using SUMPRODUCT, try

    =SUMPRODUCT(--(MONTH(A1:A100)=3),--(YEAR(A1:A100)=2014))

  5. #5
    Registered User
    Join Date
    03-05-2014
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counting if in certain cohort

    yes the date in the formula bar shows 01/03/14 but formatted to look like Mar-14

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,119

    Re: Counting if in certain cohort

    so that should work OK then

    countifs( cohort group range, cohort criteria in perf sheet, column F, TRUE)

  7. #7
    Registered User
    Join Date
    03-05-2014
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counting if in certain cohort

    I know this may seem a silly thing to say. But I don't have a countifs option in my list of formulas.
    I can email the sheet and so might be upload it once I get home. As it won't upload from my email account in my phone!!!
    I love excel it works wonders. But only when I know how to use it

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,119

    Re: Counting if in certain cohort

    PM sent

    as you are on 2003 version, then you would need to use sumproduct()

  9. #9
    Registered User
    Join Date
    03-05-2014
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counting if in certain cohort

    Ok I have done some digging on the internet and have found that i can apply multipul IF functions to the COUNT function. I am trying to apply this formula but keep getting an error messge:
    =COUNT(IF(Tracking!G7:G5000=Tracking!AC6))+COUNT(IF(Tracking!F7:F5000=Tracking!AD4))
    Any clues anyone?

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,119

    Re: Counting if in certain cohort

    i can get this to work
    =SUMPRODUCT(--(MONTH(Tracking!G7:G10)=MONTH(H5)),--(YEAR(Tracking!G7:G10)=YEAR(H5)),--(Tracking!F7:F10=TRUE))

    BUT NOT when there is a blank in column G as that then returns #value - if i apply ,--(tracking!G7:G10<>"") still not working

    I somehow need to ignore the error returned by month() when cell is ""

  11. #11
    Registered User
    Join Date
    03-05-2014
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counting if in certain cohort

    Hi etaf - im guessing you got my email? Im hoping it is easier to see what I mean, as im not great at writing what I mean!
    I was trying to see if i could get it to do multipul if functions then counting it. But as you will be able to see from the sheet ive sent you, with the examples ive created in the july table on the performance sheet where im trying to get the information to pull through to it should show a result of 1 being true/met

  12. #12
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,119

    Re: Counting if in certain cohort

    yes, been looking at this morning , and as you are on 2003 - cannot use any of the *IFS so a sumproduct would work

    works perfect if the range only includes dates , when there are blanks i get #value error and not been able to resolve


    if you change
    =IF(ISERROR(VLOOKUP(E7,$AA$6:$AC$30,3)),1/1/1900,VLOOKUP(E7,$AA$6:$AC$30,3))
    then it works , as its a date format and not a blank

    i have put in F8 , as i was not sure where the count would go

    =SUMPRODUCT(--(MONTH(Tracking!G7:G5000)=MONTH(H5)),--(YEAR(Tracking!G7:G5000)=YEAR(H5)),--(Tracking!F7:F5000=TRUE))

    the -- is converting true/false to 1/0
    so you can then count

    testing if the column G cohort is tested for the month and year gains the drop down H5
    and so only those months and years that match would be a 1 for each row that matches
    and then adding in the TRUE for column F
    so we get a count where
    month, year and TRUE all match

    you could conditional format the 1/1/1900 to have the same font as background so it looks clear

    BUT it should be easy to fix the blank dates - but not been able and tried quite a few things for about an hour this morning

    i could attach the spreadsheet - BUT not sure of the rules you are under - so would need your permission on the forum reply and i can attach in a reply
    Doesn't appear to be any private or sensitive data in the sheet

    that may help others here
    Last edited by etaf; 03-13-2014 at 07:29 AM.

  13. #13
    Registered User
    Join Date
    03-05-2014
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counting if in certain cohort

    How would i give you permission to upload the file?

  14. #14
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,119

    Re: Counting if in certain cohort

    just reply here , saying you give permission

  15. #15
    Registered User
    Join Date
    03-05-2014
    Location
    england
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Counting if in certain cohort

    Oh - lol
    I give you permission

  16. #16
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,119

    Re: Counting if in certain cohort

    please find a sample file provided by sacha.dyer , who cannot upload to the forum

    i have deleted rows below 40 - to make the files size small and load here as a sample
    Attached Files Attached Files

  17. #17
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,119

    Re: Counting if in certain cohort

    i have added the sumproduct into cells
    F8,9,10 & 11
    I have also changed the vlookup for the cohort to use 1/1/1900 instead of "", and conditional formatted the cells so if 1/1/1900 then the font is white and does not show that date
    not my best work - but further research and still cannot get the #value error resolved
    Last edited by etaf; 03-13-2014 at 08:44 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. [SOLVED] Counting Matching values in two separate ranges without counting duplicates
    By Rhall6310 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-01-2014, 03:35 PM
  2. need help with counting criteria without counting duplicate rows
    By lya in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2012, 10:14 PM
  3. Replies: 3
    Last Post: 03-01-2012, 06:17 AM
  4. Replies: 6
    Last Post: 02-04-2012, 06:57 PM
  5. counting cells with data without counting duplicates
    By labettis in forum Excel General
    Replies: 2
    Last Post: 11-05-2007, 12: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