+ Reply to Thread
Results 1 to 7 of 7

Count, in a range along a row, instances (that occur only on/before today) of a value

Hybrid View

  1. #1
    Registered User
    Join Date
    08-21-2020
    Location
    MacQuarrie Island
    MS-Off Ver
    16
    Posts
    11

    Count, in a range along a row, instances (that occur only on/before today) of a value

    I have previously learned to count, in a range down a column, instances (that only occur on/before today) of a value or values, where the dates headed up columns.
    Data appeared as time progressed, under pre-set dates. Hence the formula counted data in each column leading up to today's date.

    That was a post in this forum entitled "only-count-cells-with-any-one-of-each-of-several-separate-values-on-dates-before-today"

    Now, the same operation is needed with one difference: the data are in a single row across many columns, including in columns with dates after today. It is needed not to count any values in columns with future dates (even though those cells have been pre-filled optimistically with desired values that also happen to occur most of the time, so that as data comes in, only the less desired values need to be added by hand). The difference is that the formula needs to count, along a row, values with a certain attribute or attributes, for every date up to today.

    Here is what I have tried, without success:
    =IF($D3:$P3<=TODAY(),COUNTIFS($D24:$P24,$Q$3),"")


    A #VALUE error is generated.
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Eusr; 05-11-2021 at 02:59 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,463

    Re: Count, in a range along a row, instances (that occur only on/before today) of a value

    In Q4 enter
    Formula: copy to clipboard
    =SUMPRODUCT(--($D$3:$P$3<=TODAY())*--($D$4:$P$15=Q$3))
    and drag right

  3. #3
    Registered User
    Join Date
    08-21-2020
    Location
    MacQuarrie Island
    MS-Off Ver
    16
    Posts
    11

    Re: Count, in a range along a row, instances (that occur only on/before today) of a value

    Many thanks for your help Pepe. I'll try that out.

  4. #4
    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,595

    Re: Count, in a range along a row, instances (that occur only on/before today) of a value

    Try in RED tab

    in Q4

    =SUMPRODUCT(($D$3:$P$3<=TODAY())*($D4:$P4=$Q$3)) per row

    copy down

    or total for all rows

    in Q4

    =SUMPRODUCT(($D$3:$P$3<=TODAY())*($D4:$P42=Q$3))

    Copy across
    Last edited by JohnTopley; 05-10-2021 at 06:40 AM.

  5. #5
    Registered User
    Join Date
    08-21-2020
    Location
    MacQuarrie Island
    MS-Off Ver
    16
    Posts
    11

    Re: Count, in a range along a row, instances (that occur only on/before today) of a value

    John, your first suggestion has done the trick. In deepest gratitude I salute you.

  6. #6
    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,595

    Re: Count, in a range along a row, instances (that occur only on/before today) of a value

    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.

  7. #7
    Registered User
    Join Date
    08-21-2020
    Location
    MacQuarrie Island
    MS-Off Ver
    16
    Posts
    11

    Re: Count, in a range along a row, instances (that occur only on/before today) of a value

    Quote Originally Posted by JohnTopley View Post
    Try in RED tab

    in Q4

    =SUMPRODUCT(($D$3:$P$3<=TODAY())*($D4:$P4=$Q$3)) per row

    copy down

    or total for all rows

    in Q4

    =SUMPRODUCT(($D$3:$P$3<=TODAY())*($D4:$P42=Q$3))

    Copy across
    It is a thing of beauty.

+ 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] Use a Date Range and then count instances in another cell within that range
    By RichWW in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-10-2019, 10:09 PM
  2. [SOLVED] If statment with multiple vlookups not showing all instances that occur
    By bbeards in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-27-2017, 11:08 AM
  3. Count the number of times a quantity of entries occur within a range
    By sameg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-27-2015, 10:35 AM
  4. Returning the row numbers of all instances of a value which occur within a range?
    By Dpolinow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-06-2015, 02:54 PM
  5. Replies: 8
    Last Post: 07-14-2013, 07:29 PM
  6. Count the instances of more than one value in a given range
    By Nekto in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-19-2008, 08:45 AM
  7. Instances that occur in a sequence
    By timmycl_7 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-20-2008, 09:19 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