+ Reply to Thread
Results 1 to 7 of 7

Get the date from a run of cells from a Frequency formula

  1. #1
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Get the date from a run of cells from a Frequency formula

    Hello
    I have a Frequency formula which calculates the longest continuous run of cells with a value greater than zero. No problem there.
    Because it's possible for the run to continue over a number of days, I want to be able to get the date at the beginning of the run. The last date would be good as well provided it doesn't make the formula so complicated only a rocket scientist could work it out. I've tried index/match with no joy, which I presume is because Frequency returns an array & Index is no good for that.
    The top formula below is the continuous run formula. The lower formula is my attempt to extract the date, both are array formulas & use named ranges.
    I want to be able to do the same with a continuous run of zeros too, but I'll work that out from any help I get here.
    I've attached an example of what I'm trying to achieve.

    Thanks

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Philb1; 04-03-2015 at 03:11 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Get the date from a run of cells from a Frequency formula

    Easy peasy... with a couple helper columns.
    Attached Files Attached Files

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Get the date from a run of cells from a Frequency formula

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

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Get the date from a run of cells from a Frequency formula

    Thanks jhren

    I was trying to keep away from helper columns, but, I could use your idea with VBA, delete the columns content afterwards & leave the date values. I get the named ranges from VBA so it won't be a biggie to add.
    Cheers
    Phil

  5. #5
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Get the date from a run of cells from a Frequency formula

    Thanks benishiryo

    That's exactly what I'm after. Comparing yours & my formulas, I can see that I had the idea & should have matched the result rather than leaving the Large function in.

    Thanks for your help
    Phil

  6. #6
    Valued Forum Contributor
    Join Date
    05-20-2013
    Location
    Ohio, USA
    MS-Off Ver
    Excel 2013
    Posts
    941

    Re: Get the date from a run of cells from a Frequency formula

    Quote Originally Posted by benishiryo View Post
    hi Philb1. try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Quote Originally Posted by Philb1 View Post
    Thanks benishiryo

    That's exactly what I'm after. Comparing yours & my formulas, I can see that I had the idea & should have matched the result rather than leaving the Large function in.

    Thanks for your help
    Phil
    I tried that and thought it didn't work. But now I see it works but only it gives the date at the end of the run. To get start date...
    {=INDEX(ERange,MATCH(C5,FREQUENCY(IF(LRange>0,ROW(LRange)),IF(LRange<=0,ROW(LRange),0)),0)-C5)}

  7. #7
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Get the date from a run of cells from a Frequency formula

    Sorry for the delay in getting back here

    Thanks jhren, that formula does work as you say

    benisiyryo.. Your formula gave the result for the row after the run of cells. If there were 14 rows in a column with a value greater than zero, the formula gave the date for the 15th row.
    Adding offset to your formula overcame that issue

    Please Login or Register  to view this content.
    Thank you both for your help & rep has been done for both of you

    Cheers


    Quote Originally Posted by jhren View Post
    I tried that and thought it didn't work. But now I see it works but only it gives the date at the end of the run. To get start date...
    {=INDEX(ERange,MATCH(C5,FREQUENCY(IF(LRange>0,ROW(LRange)),IF(LRange<=0,ROW(LRange),0)),0)-C5)}
    Last edited by Philb1; 04-04-2015 at 07:04 PM. Reason: Tried to get rid of the balloon at the bottom. To hard & gave up

+ 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 for date as per given frequency period
    By vrumapathy in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-28-2014, 02:35 AM
  2. Replies: 3
    Last Post: 02-11-2014, 05:36 PM
  3. Frequency Formula for Greatest Occurrence by Date
    By rick60 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-05-2013, 02:18 PM
  4. conditional formatting formula to check frequency of occurence in date range?
    By seanblanton in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-27-2013, 05:50 PM
  5. Frequency Due Date Formula
    By ainokoori in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-26-2011, 12:58 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