+ Reply to Thread
Results 1 to 2 of 2

CountIF with two conditions

  1. #1
    Registered User
    Join Date
    02-13-2012
    Location
    bauru
    MS-Off Ver
    Excel 2010
    Posts
    1

    Thumbs up CountIF with two conditions

    Hi, i've read other topics about countif with two conditions, but didin't had a satisfatory answer for my problem.

    I have a sheet with two colums:

    A B
    NAME AGE


    A B
    ROGER 18
    ANDREAS 42
    CARL 21
    MIKE 05

    This sheet has over 10.000 lines ^^.

    I'd like to count how many of these people has age between 0 and 5 years (math transcription >=0<=5), 6 and 10 (>=6<=10) and keep going...

    I've read about sumproduct, many topics change countif to sumproduct, but it doesn't help me at all...

    I created another column with the variables writen in math formulas, for ex:

    Column D
    Line 1) >=18<=24
    Line 2) >=25<=30
    Line 3) >=31<=35

    and then i tried to link this cells as a condition of the countif formula. for ex.: =COUNTIF(A4:B4;D2), but it doens't show me the correct result, it always shows "1".

    If someone could help, 'l appreciate it.

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

    Re: CountIF with two conditions

    You can't link the cells like that...

    In Excel 2010 use COUNTIFS

    e.g.

    =COUNTIFS(B2:B4;">=18";B2:B4;"<=24")

    or if you have the numbers in cells...

    =COUNTIFS(B2:B4;">=" & D2;B2:B4;"<=" & D3) where D2 and D3 contain 18 and 24, respectively
    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.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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