+ Reply to Thread
Results 1 to 2 of 2

Comparing a data range against a range of dates

Hybrid View

  1. #1
    Registered User
    Join Date
    08-16-2021
    Location
    Bristol
    MS-Off Ver
    Office365
    Posts
    26

    Comparing a data range against a range of dates

    Hi all!

    I think I am nearly there with this, but just need a bit of help with syntax. So, I have four columns of data, B to F, the cells of which hold one of seven key words. On my dashboard, I want to be able to calculate a cumulative total for each of these keywords for the life of the project, so I don't actually need a date range here, I just count the words. Easy. For example:

    =COUNTIFS(Cumulative!$B$2:$F$999,"Keyword")

    Counts the instance of "Keyword" on the range of cells B2:F999.

    The problem comes when I then use a date range to calculate how many instances there are between 1/9/2022 and a recent reporting date for each monthly report; for this month it is 31/1/2023.

    I have tried using:

    =COUNTIFS(Cumulative!$H$2:$H$999, ">=&DATE(2022, 9, 1), Cumulative!$H$2:$H$999, "<=&DATE(2023, 1, 31), Cumulative!$B$2:$F$999,"Keyword")

    The problem seems to be using the array for the data in multiple columns B to F to find "Keyword". Even if I add multiple lines and have four lots of criteria for individual columns, it still doesn't return the correct value.

    Can you help? The one thing to add is that in that array containing the keywords, there are a large number of blank cells.

  2. #2
    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
    30,838

    Re: Comparing a data range against a range of dates

    Without a file .....?

    Please yellow banner at top of page on how to attach a sample workbook.

    or try


    Formula: copy to clipboard
    =SUMPRODUCT((Cumulative!$H$2:$H$999>=DATE(2022,9,1))*(Cumulative!$H$2:$H$999<=DATE(2023,1,31))*(Cumulative!$B$2:$F$999="Keyword"))


    Better to put your dates into cells rather than hard-code them
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. Formula to look at a range of cells, match dates within the range and pull data.
    By mark.k.conroy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-04-2019, 10:20 AM
  2. [SOLVED] Data Validation comparing a range to another range?
    By XLOOKUP in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-11-2016, 04:51 PM
  3. Conditional formatting comparing 2 dates and using range.
    By K_berly in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-25-2015, 11:54 AM
  4. Replies: 4
    Last Post: 08-04-2014, 04:48 AM
  5. [SOLVED] IF function - comparing data in range
    By Yahoho in forum Excel General
    Replies: 10
    Last Post: 06-15-2012, 08:38 AM
  6. Replies: 2
    Last Post: 09-10-2010, 03:15 PM
  7. Looping through rows in range AND comparing range cells
    By Damask in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-16-2006, 10:30 PM

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