+ Reply to Thread
Results 1 to 3 of 3

Counting number of times a specific number is followed by another specific number

  1. #1
    Registered User
    Join Date
    07-13-2011
    Location
    Glasgow
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    21

    Counting number of times a specific number is followed by another specific number

    Hi there , I was looking for some help on a problem I have with excel.

    What I am trying to do is count how many times a specific number is immediately followed by another specific number in a long list of time series of data.

    For instance say I have 5000 numbers in cells A1:A5000 these numbers all range from 0 to 1.What I want to do is count the number of times that the number 0.5 is followed by 0.51 so the example below would return a value of 2 as 0.5 is immediately followed by 0.51 twice.

    Does anyone know how to achieve this?

    A
    0.5
    0.51
    0.6
    0.6
    0.5
    0.51
    0.7
    0.51
    0.6


    Thank you

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Counting number of times a specific number is followed by another specific number

    Try something like:

    =SUMPRODUCT(--(A1:A9=0.5),--(A2:A10=0.51))

    notice the second range is offset by one row at start and at end...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-13-2011
    Location
    Glasgow
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    21

    Re: Counting number of times a specific number is followed by another specific number

    Thank you so much NVBC

    Worked beautifully, ive been trying to do this for hours just couldn’t get it.

    Much appreciated

+ 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