+ Reply to Thread
Results 1 to 6 of 6

Find cells with value greater than value of other cell+1

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question Find cells with value greater than value of other cell+1

    Hi! I've got this thing that I really can't figure out, and it would be a big help if someone could give me advice.

    I want to count the times that a value in one column has a value of one greater than the value of the corresponding cell in another column. (For example, A1=1 and B1=2, A2=1 and B2=2, etc.) I've tried =COUNTIFS(A1:A180, (B1:B180)+1) and =COUNTIFS(A1:A180, "="&(B1:B180)+1) with no luck. (It gives me a value of zero, but I can tell just by looking at the numbers that there should be at least a few times when this event occurs.)

    Could someone suggest a way to do this, or let me know if it's even possible? Thank you very much!

  2. #2
    Forum Contributor Dave H9's Avatar
    Join Date
    03-10-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    418

    Re: Find cells with value greater than value of other cell+1

    I would use a helper column in C and compare A & B with an IF function to return 0 if false and 1 if true. You can then just total column C.

    Hope that helps

    Dave H
    - Mark your post [SOLVED] if it has been answered satisfactorily, by editing your original post using advanced mode.
    - Thank those that provided useful help, its nice and its very well appreciated...use the star on the lower left of the post

  3. #3
    Forum Contributor
    Join Date
    03-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: Find cells with value greater than value of other cell+1

    Hi,

    Please try entering this array formula. Paste in the formula into the formula bar and press Control + Shift + Enter at the same time:

    =SUM(IF(ABS(A1:A180-B1:B180)=1,1,0))

    This will give you a count of occurrences where the difference between the two items is 1

    If entered correctly, Excel will automatically place curly brackets around the formula after Control+Shift+Enter is pressed


    {=SUM(IF(ABS(A1:A180-B1:B180)=1,1,0))}
    Last edited by Jarko28; 04-19-2013 at 08:16 PM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Find cells with value greater than value of other cell+1

    Hi and welcome to the forum

    An alternative would be this regular formula (no CTRL SHIFT enter needed)...

    =SUMPRODUCT((A1:A10)*(B1:B10>A1:A10))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Contributor
    Join Date
    03-27-2012
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    154

    Re: Find cells with value greater than value of other cell+1

    FDibbins

    I don't think that this sumproduct formula counts the instances where the number between each row is 1... unless I am misunderstanding the request.

    Thanks.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Find cells with value greater than value of other cell+1

    You are correct, I missed the "one" greater

+ 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