+ Reply to Thread
Results 1 to 5 of 5

Need array formulas for Countif that counts row by row and an array Mod formula

  1. #1
    Registered User
    Join Date
    04-06-2020
    Location
    USA
    MS-Off Ver
    MS Office 365
    Posts
    5

    Smile Need array formulas for Countif that counts row by row and an array Mod formula

    I work for a non-profit that needs to track sessions with client's. I'm hoping to utilize array formula so that when adding new clients (rows) the formula keeps auto populating. So here is the breakdown, I would like to create an array in cell b7 that will count all of the "True" / Checked boxes in each row and count them row by row and not the total across all rows if that make sense. THEN, I would like to create a arrayformula in c7 that looks at column b and notifies me (via s true false statement) if the sum of B is divisible by 6 (the clinicians need to complete a specific task every sixth sessions so I created a conditional formatting that turns the row green if the column c reads true of false).

    Special requests... could your magic formulas include a condition where the value is blank if there is no client name in column D.

    Included is a sample of the document in question. Please make the formula able to be carried over to google sheets as this is the platform our agency uses to collaborate on these shared documents.

    I truly appreciate any help in this matter.
    Attached Files Attached Files
    Last edited by Slickback724; 11-05-2021 at 10:58 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Need array formulas for Countif that counts row by row and an array Mod formula

    Can's speak for Google sheets, you'll have to check,

    B7: =COUNTIFS(AE7:JN7,TRUE)
    C7: =IF(MOD(B7,6)=0,TRUE,FALSE)

    Use Conditional format in B7: =D7=""
    and choose Font colour white

    Similarly for C7
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    04-06-2020
    Location
    USA
    MS-Off Ver
    MS Office 365
    Posts
    5

    Re: Need array formulas for Countif that counts row by row and an array Mod formula

    Thank you Richard for the quick reply... I was able to make the C7 cell an array by using this formula...
    =Arrayformula(IF(MOD(B7:B,6)=0,TRUE,FALSE))
    Do you have any ideas for the B7 cell? As is the function is dragfill instead of autofill using arrays. Any thoughts on how to turn B7 into an array?

    I really appreciate your guidance.

  4. #4
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Need array formulas for Countif that counts row by row and an array Mod formula

    this could be accomplished with an onEdit Apps Script, instead of array formulas.

    this script does NOT obey cell colouring... so black cells (B20 and C20) will have their colour changed to clear, and you will need to go back to those cells and colour them again.

    heres the script:

    Please Login or Register  to view this content.
    and heres some slight changes to the formulas, that will keep the cell clear if the cell in column D is empty..

    B7:
    Please Login or Register  to view this content.
    C7:
    Please Login or Register  to view this content.
    Steps to follow:
    1. go to Extensions -> Apps Script
    2. select everything in the existing base script, and overwrite with the script given above
    3. save the script
    4. enter the B7 formula, and hit enter, DO NOT accept the G-Sheets Autofill prompt, then wait for about 20 seconds while the script does its work and Autofills down to all other rows
    5. enter the C7 formula, and hit enter, DO NOT accept the G-Sheets Autofill prompt, then wait for about 20 seconds while the script does its work and Autofills down to all other rows
    6. if the script does not fill down far enough, then simply delete the formula, then enter it again, and it will push down further each time
    7. recolour cells B20 and C20
    8. DONE!
    Last edited by janmorris; 11-08-2021 at 11:26 PM.

  5. #5
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Need array formulas for Countif that counts row by row and an array Mod formula

    Arrayformulas that ignore blank in column D

    B7:
    Please Login or Register  to view this content.
    C7:
    Please Login or Register  to view this content.

+ 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] Array reference in a cell: difference using or not array formulas
    By RiccardoS89 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 07-05-2019, 12:07 PM
  2. Using COUNTIF function, Array formulas
    By jmusilli11 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-15-2018, 09:00 AM
  3. Array formula for unique counts with OR conditions
    By bubba930 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-09-2018, 03:27 PM
  4. IF and COUNTIF array formulas
    By Kevrhof in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-23-2014, 06:15 PM
  5. Question about using Evaluate with an array of formulas not an array formula
    By Mr_Bill in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2014, 03:26 PM
  6. Looking for counts from an array
    By Johnmitch93 in forum Excel General
    Replies: 6
    Last Post: 01-28-2012, 09:37 AM
  7. Replies: 6
    Last Post: 12-30-2008, 06:52 AM

Tags for this Thread

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