+ Reply to Thread
Results 1 to 7 of 7

Difference between consecutive number

  1. #1
    Registered User
    Join Date
    08-18-2010
    Location
    luffs
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Difference between consecutive number

    Hi all

    Basically I have a large column of data (15000 values) and would like to out how many pairs have a difference of less than 10.

    ie A
    1 45
    2 50 In this case there are 2 instances, (A1 and A2), and (A2 and A3)
    3 42
    4 25
    5 90


    Been playing around with the =COUNTIF code but I just can't manage to do it

    Any help would be appreciated!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Difference between consecutive number

    Welcome to the forum.

    Assuming you mean adjacent pairs,

    =SUMPRODUCT(--(ABS(A1:A4-A2:A5)<10))
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor meyero90's Avatar
    Join Date
    03-24-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    202

    Re: Difference between consecutive number

    do you mean compare pairs in columns A and B?
    is there a way you can attach a simplified spreadsheet with some dummy data?
    If I helped, Don't forget to add to my reputation (click on the little scale)
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)

  4. #4
    Registered User
    Join Date
    08-18-2010
    Location
    luffs
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Difference between consecutive number

    Brilliant, thanks! now i can stop banging my head against a wall

  5. #5
    Forum Contributor meyero90's Avatar
    Join Date
    03-24-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    202

    Re: Difference between consecutive number

    hi shg,

    can you briefly explain the combination of these "--" with SUMPRODUCT. I often use a sumproduct(--(range1=criteria),(range2=criteria)). BUT I never understood the implication of this "--". Thanks for enlightening me on this subject.

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

    Re: Difference between consecutive number

    Have a good read through this article: Sumproduct
    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.

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Difference between consecutive number


+ 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