Results 1 to 2 of 2

Thread: How to count in excel with a variable data as condition
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Apr 2014
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default How to count in excel with a variable data as condition

    Hi,

    I'm not sure how or where to find answer to the next question

    I want to count how many cell are valid to a conditional value.

    Let me explain using a table

    4 11 240 6
    5 7 360 3
    3 17 101 4
    4 1 300 4
    5 3 360 4
    4 13 243 3
    3 15 135 1

    I want to know how many cell in the last column have a value 2 less than the value in the first column. Without use of an extra column.

    I think something with countif(D:D;....
    But what do I use as criteria???

    Does anyone know???

    Thanks

  2. #2
    Board Regular Snakehips's Avatar
    Join Date
    May 2009
    Location
    Coventry UK
    Posts
    4,608
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Default Re: How to count in excel with a variable data as condition

    Elsave,

    Welcome to MrExcel.

    Assuming a data range of A1:D1000 (You may edit the rows to suit your max data range)

    Perhaps try....

    =SUMPRODUCT(--($A$1:$A$1000-$D$1:$D$1000=2))

    Hope that helps.
    Tony

    AbUsing Excel 2002 to 2013
    This line will be updated just as soon as I come up with something, original, witty, profound or interesting. Please don't hold your breath!

    Please remember - we cannot see your workbook nor read your mind.
    Help us to help you, post clear detail of what you have and what you want - from the start.

    A screen shot can save a thousand words!
    Post a screen shot with one of these: Excel Jeanie, MrExcel HTML Maker
    If posting VBA code, please use Code Tags - see: here

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •