+ Reply to Thread
Results 1 to 4 of 4

apply formula to array, then COUNT

  1. #1
    Registered User
    Join Date
    05-15-2024
    Location
    Queensland, Australia
    MS-Off Ver
    Google Sheets
    Posts
    2

    apply formula to array, then COUNT

    G'day,
    I'm a farmer using excel via GOOGLE SHEETS to keep records on our cattle grazing grass business.
    I have a set of animal weights (kg) going over several columns.
    I have used the COUNTIF function to give me the results below showing the number of animals that fall into these different weight ranges ...... eg =COUNTIF(B:G,">=300")-COUNTIF(B:G,">339")

    I also need the number of animals in these different weight ranges for their FUTURE PREDICTED weight ... ie, data set + (days * daily weight gain kg/day) .... then results arranged as per below.

    COUNTIF doesn't seem to be able to handle this extra calculation ..... =(COUNTIF(B:G,"+(K29*K30)<=300")-(COUNTIF(B:G,"(+K29+K30)<=339")) ... doesn't work.

    How else might I be able to achieve this?
    I hope this makes sense. Thank you for your help!


    weight range Number of animals
    <=220kg 59
    220 - 259 kg 58
    260 - 299 kg 25
    300 - 339 kg 12
    340 - 379 kg 1
    380 - 419 kg 1
    420 - 439 kg 0
    440 - 479 kg 0
    480 - 519 kg 0
    520 - 559 kg 0
    560 - 600 kg 0
    >=600kg 0

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

    Re: apply formula to array, then COUNT

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. The sample layout accurately matches that of your real data. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    05-15-2024
    Location
    Queensland, Australia
    MS-Off Ver
    Google Sheets
    Posts
    2

    Re: apply formula to array, then COUNT

    Thankyou. See attached worksheet. The cells I am having trouble with are colored yellow. Thanks again.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2019
    Posts
    4,542

    Re: apply formula to array, then COUNT

    Try, using COUNTIFS
    J35: =COUNTIFS(B:G,"<"&220-J28*J29)
    J36: =COUNTIFS(B:G,">="&220-J28*J29,B:G,"<="&259-J28*J29)
    Attached Files Attached Files

+ 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] Need to apply advanced array vlookup formula in vba code
    By Pankaj jaswani in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2022, 01:08 AM
  2. [SOLVED] Apply Interpolation Formula to Scattered Blank Cells in an Array
    By udf463 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2021, 07:11 PM
  3. [SOLVED] Apply SUMIFS Formula to an Array
    By allenneukomm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-12-2017, 11:11 AM
  4. Need to apply a Vlookup formula from VBA to excel in an array
    By jmacinnees in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2014, 01:35 AM
  5. [SOLVED] (urgent help pls) how to apply array formula with ctrl+shift+enter
    By otabokauyelikicin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2013, 09:56 AM
  6. How to apply ISERROR in an Array Formula
    By kborgers in forum Excel General
    Replies: 4
    Last Post: 01-13-2012, 03:38 PM
  7. Using VLOOKUP to apply an ARRAY formula
    By monkdelafunk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-29-2008, 10:22 PM

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