+ Reply to Thread
Results 1 to 15 of 15

Format for Countifs specifc data AND date field

  1. #1
    Registered User
    Join Date
    03-10-2019
    Location
    uk
    MS-Off Ver
    office 365
    Posts
    14

    Format for Countifs specifc data AND date field

    Hi All,

    I have to survey the audiences to our events, and i eventually get an excel file with all the results in of the surveys. for instance 1 column would hold the age bracket of the respondents. 0 to 15, 16-19 etc.

    I have to report to my funders in a specific format - by quarter April to June, July to September etc - the count of 16-19 year olds in each quarter.

    I can easily do =COUNTIF(T1:T1000,"16-19") which gives me the total number of 16-19 year olds overall.

    BUT I would really like the formula to only give me the number of 16-19 year olds in each quarter.

    I realise that this involves COUNTIFS, but i cant seem to get the syntax right.

    any help gratefully received!

    thanks

    ian

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,857

    Re: Format for Countifs specifc data AND date field

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    03-10-2019
    Location
    uk
    MS-Off Ver
    office 365
    Posts
    14

    Re: Format for Countifs specifc data AND date field

    Apologies Ali, and everyone.

    I have put some dummy data in this spreadsheet and on another Tab the funders form I have to fill in.

    Thanks

    Ian
    Attached Files Attached Files

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Format for Countifs specifc data AND date field

    Hi ian,

    Find the attached: Attendence Pivot with groups of Date and Age.xlsx
    Where I created 1000 rows of random dates, in 2020, and ages between 10 and 90.
    Then a Pivot Table where I've grouped by dates in column A and ages of column B in a Pivot Table and Chart. I think this is what you are looking for.
    Learn a bit more about Pivot Tables and grouping and you can do this same thing with your data.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    03-10-2019
    Location
    uk
    MS-Off Ver
    office 365
    Posts
    14

    Re: Format for Countifs specifc data AND date field

    Thanks Marvin. I haven't used Pivot Tables before, so I will def look into it. I assume they work with text fields too? as in the age range will be a text field "16-19".

    Always excited to learn something new in excel.

    Thanks again,

    Ian

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Format for Countifs specifc data AND date field

    Hi Ian,

    You need to make your dates, real dates which I've done in Date2, inserted column. Then a Pivot Table with Slicers would be my choice to fill in your sheet 2. See this attached with my work.
    Audience Analysis 2.xlsx
    Also you need to make unique names on row 3 for your pivot to work. Having the word "Response" multiple times in row 3 keeps Pivots from working.

  7. #7
    Registered User
    Join Date
    03-10-2019
    Location
    uk
    MS-Off Ver
    office 365
    Posts
    14

    Re: Format for Countifs specifc data AND date field

    Thanks Marvin, I am sure I can get my head around Pivot charts at some point. I appreciate you doing a sample for me.

    I wish there was an easier method at this point using COUNTIFS though.

    Ian

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Format for Countifs specifc data AND date field

    Example of Q1 (assuming i is January-March)

    =COUNTIFS(SurveyMonkeyData!$K$3:$K$27,"16-19",SurveyMonkeyData!$B$3:$B$27,">=" & DATE(2021,1,1),SurveyMonkeyData!$B$3:$B$27,"<=" &DATE(2021,3,31))

    The dates in your file need reviewing!
    Last edited by JohnTopley; 05-24-2021 at 11:20 AM.

  9. #9
    Registered User
    Join Date
    03-10-2019
    Location
    uk
    MS-Off Ver
    office 365
    Posts
    14

    Re: Format for Countifs specifc data AND date field

    Hi John,

    That's it! Thank you. Yes, when i put the dates in properly, the correct numbers came through.

    Many thanks!

    Ian

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Format for Countifs specifc data AND date field

    You could make life easier by changing the "AGE" in column C to "0-15", "16-19" etc then insert (for example) C20 to replace "16-19" in the formula I provided thus you can simply copy the formula down column E for the AGE analysis.

    In similar way, you could add cells with Qtr start/end dates so you do not have to repeatedly hard code them in your formulae.

  11. #11
    Registered User
    Join Date
    03-10-2019
    Location
    uk
    MS-Off Ver
    office 365
    Posts
    14

    Re: Format for Countifs specifc data AND date field

    Yes!! I like that plan a lot. I can add the actual text of the Age range in the notes section (without messing with the funders form, and reference those cells in the formulae.

    If I add the start and end dates to the notes field for easy reference, i assume i replace the "<=" &DATE(2021, 4,1) with "<=" & N9 (N9 being where i placed the Quarter start date.)?

    i'll give it a go now.

    Ian

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Format for Countifs specifc data AND date field

    "<=" & N9
    Yes... that is correct.

  13. #13
    Registered User
    Join Date
    03-10-2019
    Location
    uk
    MS-Off Ver
    office 365
    Posts
    14

    Re: Format for Countifs specifc data AND date field

    works a treat, many thanks John.

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Format for Countifs specifc data AND date field

    You're welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  15. #15
    Registered User
    Join Date
    03-10-2019
    Location
    uk
    MS-Off Ver
    office 365
    Posts
    14

    Re: Format for Countifs specifc data AND date field

    Thanks John, I'll mark as solved. I believe I have already - if thanking is the same as adding to reputation. :-)

+ 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. Extract the date from a text field and make it into a date format
    By dkfresh in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-19-2021, 11:07 PM
  2. [SOLVED] Need help combining text and numerics to create a specifc format name
    By Ride4zen in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-20-2019, 07:51 PM
  3. [SOLVED] Concatenate a date field keeping the date format
    By rrcrossman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2016, 04:28 PM
  4. [SOLVED] Chaneg value to Date format within same field A1
    By nironto in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-17-2013, 02:25 AM
  5. Replies: 1
    Last Post: 04-11-2013, 12:22 AM
  6. Extract a date from a field and append another field's data
    By Leroy221 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-07-2012, 11:35 AM
  7. Replies: 1
    Last Post: 07-25-2012, 07:44 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