+ Reply to Thread
Results 1 to 6 of 6

Calculating the interval difference between occurrences

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    Goa, India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Calculating the interval difference between occurrences

    Hi, I wonder if someone can help me with my issue.

    I have a column randomly filled with single digit numbers. I wanted to know if, taking the bottom empty cell as the end of range for this said column, can a formula be written to calculate the difference of occurrence of a particular number.

    Please check the attached file and check the comment in B20, for more details.

    Thanks,

    -JB.
    Attached Files Attached Files

  2. #2
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Calculating the interval difference between occurrences

    Does this help:
    =COUNTA($B$2:$B$20)-MAX(IF($B$2:$B$20=E2,ROW($B$1:$B$19)))
    (confirm CTRL+SHIFT+ENTER)

  3. #3
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Calculating the interval difference between occurrences

    Hi JB,

    Since you have 0's in the range MAX may give -ve results If 0's NOT in the range., a little change to dewilk's formula.

    =COUNTA(B$2:B$200)-LARGE(IF((B$2:B$200<>"")*(B$2:B$200=E2),ROW(B$2:B$200)),1)+1

    with CTRL+SHIFT+ENTER. If a number doesn't found will return an error.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  4. #4
    Registered User
    Join Date
    06-12-2012
    Location
    Goa, India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Post Re: Calculating the interval difference between occurrences

    Hi dewilk & Haseeb.

    Thanks for the prompt response.

    I did try using the formula in cell F2. However, the result that I get is wrong. I am sorry if I was not clear enough. The formula should match the number in E2 & count from the bottom of the range in column B, to check when it had last occurred.

    For e.g. 3 has just occurred very recently. So, the result in F5 should be '0'

    I hope I am clearer this time.

    Haseeb, I had come across another of your posts titled, "Difference in occurrence". Thought that this would be something similar.

    Thanks for all the help.

    -JB

    P.S.: The numbers in column "F" are the results that I am looking for with the formula.
    P.P.S.: Also, would you please explain to me what "CTRL+SHIFT+ENTER" is for...?

    Quote Originally Posted by Haseeb A View Post
    Hi JB,

    Since you have 0's in the range MAX may give -ve results If 0's NOT in the range., a little change to dewilk's formula.

    =COUNTA(B$2:B$200)-LARGE(IF((B$2:B$200<>"")*(B$2:B$200=E2),ROW(B$2:B$200)),1)+1

    with CTRL+SHIFT+ENTER. If a number doesn't found will return an error.
    Last edited by jasonsarea; 06-13-2012 at 05:36 AM.

  5. #5
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Calculating the interval difference between occurrences

    See the attached.

    These articles may give you some idea about Array Formulas.

    Array Formulas, Array Formula Samples

  6. #6
    Registered User
    Join Date
    06-12-2012
    Location
    Goa, India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Calculating the interval difference between occurrences

    Thanks a lot Haseeb. That did it. Understood a little more about Excel. :-)

    Cheers,
    -Jason

    Quote Originally Posted by Haseeb A View Post
    See the attached.

    These articles may give you some idea about Array Formulas.

    Array Formulas, Array Formula Samples

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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