+ Reply to Thread
Results 1 to 8 of 8

Find a value in a column and count text using a rolling date range

  1. #1
    Registered User
    Join Date
    08-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    52

    Find a value in a column and count text using a rolling date range

    Good morning

    I'm trying to create a formula that will take a value from a cell and find the value in a row. Then count a number of time a text string appears in the column, using a rolling date range.


    I was thinking I could use a HLOOKUP to find the value in the row, but then I think I need a nested COUNTIF statement to count the number of occurrences of my string "txt". But I need the range to be rolling so something like TODAY() - 365:TODAY() for the date range.

    Or do I need to use a INDEX formula?

    Any thoughts


    Thanks
    Dave
    Attached Files Attached Files

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Find a value in a column and count text using a rolling date range

    Put this cell F2:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You don't make clear the 'rolling date range', but the rows offset can be controlled by date parameters. How did you want to specify the date range?
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    08-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Find a value in a column and count text using a rolling date range

    Hi thanks for your reply

    Sorry I didn't make it very clears. What I'm looking for is the data selected in C2 is searched it the data table. Then every time a specific string "txt" or "ABS" which is identified in the formula is counted, because there will be different springs in the columns. But here's the catch I want the range to be dynamic based on today date going back a year or 365 days, so something like TODAY()-365:TODAY(). Only counting the "text" that appears within the last year. I'm ok if it has to be done in two formula's one to count the string within the dynamic date range and a Hlookup to reference the first formula. I'm not sure if that made it any clearer for you.

    Thanks
    Dave

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Find a value in a column and count text using a rolling date range

    Okay. Use:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Find a value in a column and count text using a rolling date range

    This is great, only one thing there will be different information in the columns like txt or abs etc. so the COUNTA wont work, can we use a COUNTIF? to specify the text string we are looking for?

    Thanks
    Dave

  6. #6
    Registered User
    Join Date
    08-29-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2007
    Posts
    52

    Re: Find a value in a column and count text using a rolling date range

    Hi I just swapped out the COUNTA for a COUNTIF and included "txt". It work great. Thanks for your help, you rock!!!!

    Thanks
    Dave

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Find a value in a column and count text using a rolling date range

    Quote Originally Posted by JonesyCC View Post
    This is great, only one thing there will be different information in the columns like txt or abs etc. so the COUNTA wont work, can we use a COUNTIF? to specify the text string we are looking for?

    Thanks
    Dave
    Yes, you can

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Find a value in a column and count text using a rolling date range

    Quote Originally Posted by JonesyCC View Post
    Hi I just swapped out the COUNTA for a COUNTIF and included "txt". It work great. Thanks for your help, you rock!!!!

    Thanks
    Dave
    Excellent, glad it's helped.

+ 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. Replies: 1
    Last Post: 02-05-2013, 09:14 AM
  2. Replies: 8
    Last Post: 03-16-2011, 11:26 AM
  3. Formula to Check Column A for date range and count Column B
    By realniceguy5000 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-28-2009, 12:58 PM
  4. [SOLVED] Count text values in a date range
    By Janet BN in forum Excel General
    Replies: 2
    Last Post: 06-18-2006, 11:30 PM
  5. Replies: 25
    Last Post: 09-07-2005, 12:05 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