+ Reply to Thread
Results 1 to 12 of 12

GOOGLE SHEETS: countif with dynamic range

  1. #1
    Registered User
    Join Date
    12-30-2019
    Location
    england
    MS-Off Ver
    2019
    Posts
    5

    GOOGLE SHEETS: countif with dynamic range

    I have created a basic attendance sheet for our football team for the new year. We normally run training sessions on a Wednesday and a Sunday. If a player attends, they get a green check, if they don't it's a red cross. So that's pretty simple to count up with ''countif''

    What i'm trying to do is create a formula that will count the last 10 sessions we have run. "=COUNTIF(A1:A10,"✔️")" The problem with that formula is that not only would the range have to update every session "A2:A11" but there are some Wednesday's and Sundays when we don't run a session and i need this to be skipped.

    I thought about created a referance "attendee'' that would have perfect attandance and the range could be worked from that. So it would count 10 "✔️" maybe output the range to another cell and the other formula picked up from there.

    A bit stuck. Any ideas would be much appreciated
    Attached Files Attached Files
    Last edited by AliGW; 12-30-2019 at 08:42 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    47,053

    Re: countif with dynamic range

    Welcome to the forum.

    Read the instructions at the top of the page about how to attach your workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Registered User
    Join Date
    12-30-2019
    Location
    england
    MS-Off Ver
    2019
    Posts
    5

    Re: countif with dynamic range

    Sorry, attached the sheet now

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Sadly... in lockdown, but based in Ireland.
    MS-Off Ver
    µSoft Office 365. Learning Excel all over again!!
    Posts
    29,938

    Re: countif with dynamic range

    Unfortunately, this doesn't help hugely. it's blank. Some manually calculated expected results where you want to see them would help!!!
    Glenn



  5. #5
    Registered User
    Join Date
    12-30-2019
    Location
    england
    MS-Off Ver
    2019
    Posts
    5

    Re: countif with dynamic range

    Hi, sorry about that. I have cut it down and added in some data. Hopefully that will help.
    Last edited by AliGW; 12-30-2019 at 07:28 AM. Reason: Please don't quote unnecessarily!

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Sadly... in lockdown, but based in Ireland.
    MS-Off Ver
    µSoft Office 365. Learning Excel all over again!!
    Posts
    29,938

    Re: countif with dynamic range

    Yep. It does!!

    =COUNTIF(INDEX(17:17,AGGREGATE(14,6,(($C$21:$BK$21="✔")*(COLUMN($C$21:$BK$21))),10)):BK17,"✔")

    copied down. How does that look?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-30-2019
    Location
    england
    MS-Off Ver
    2019
    Posts
    5

    Re: countif with dynamic range

    Yes! That works great thanks for that.

    I thought it would port over to Google Sheets but for some reason the last range '':BK17,'' is not picked up in there.
    Last edited by AliGW; 12-30-2019 at 08:28 AM. Reason: Please don't quote unnecessarily!

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Sadly... in lockdown, but based in Ireland.
    MS-Off Ver
    µSoft Office 365. Learning Excel all over again!!
    Posts
    29,938

    Re: countif with dynamic range

    I wouldn't know a Google sheet from a hole in my socks!! Can't help you there....

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    47,053

    Re: countif with dynamic range

    Would you like this thread moving to the Google Sheets section?

    Administrative Note:

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below or the REPLY button instead of REPLY WITH QUOTE.

  10. #10
    Registered User
    Join Date
    12-30-2019
    Location
    england
    MS-Off Ver
    2019
    Posts
    5

    Re: countif with dynamic range

    Yeah please! Glenn's formula worked a treat. Can't thank him enough.

    Google sheets returns the value as zero. It doesn't look like it picks up the last cell range '':BK17''. Removing the ":", it seems to pick it up but gives a parse error.
    Last edited by AliGW; 12-30-2019 at 08:40 AM. Reason: Please don't quote unnecessarily!

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    47,053

    Re: countif with dynamic range

    You have just quoted an entire post in which I asked you NOT to quote entire posts! Please stop doing this.

    I shall move the thread for you.

  12. #12
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    2016 primarily
    Posts
    5,888

    Re: GOOGLE SHEETS: countif with dynamic range

    Sheets doesn't have an AGGREGATE function, so use something like:


    =COUNTIF(INDEX(17:17,LARGE((($C$21:$BK$21="✔")*(COLUMN($C$21:$BK$21))),10)):BK17,"✔")
    Rory
    I drink, and I know things

+ 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] Countif dynamic range
    By pauldaddyadams in forum Excel General
    Replies: 4
    Last Post: 01-11-2017, 04:11 PM
  2. Replies: 2
    Last Post: 10-13-2016, 12:28 PM
  3. [SOLVED] Countif Dynamic Range
    By ajw089 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-04-2016, 05:25 PM
  4. [SOLVED] Help with offest and countif (Dynamic range)
    By LEEDA12345 in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 02-21-2014, 10:13 AM
  5. Using COUNTIF with a dynamic range
    By ruthjames in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-25-2013, 11:20 AM
  6. COUNTIF: dynamic range
    By BATISTAJM in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-22-2013, 07:17 PM
  7. Dynamic Range using Offset and CountIF
    By mark_jam3s in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-04-2008, 11:43 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