Consulting

Results 1 to 5 of 5

Thread: Solved: Counting cells in one column based on values in a different column.

  1. #1

    Solved: Counting cells in one column based on values in a different column.

    Sorry if this been asked and answered before, but I've done a lot of searches and cannot find anything.

    In the example below, I need to try to take a Count of ColC IF ColB=1. So the result from the two columns below would be 3.

    ColB ColC
    1 100%
    2 99%
    4
    3 90%
    1
    4 100%
    1 98%
    1 100%

    I've tried the following formulas but have not had any success.
    =COUNT($C:$C,$B:$B=1)
    =IF(B:B=1,COUNT(!C:C))
    =COUNTA(IF($B:$B=1,$C:$C))
    =COUNTIF($C:$C,$B:$B=1)

    Any help would be greatly appreciated!

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    If you want to count the number of cells in B that have one
    =COUNTIF(B:B, 1)

    If you want to sum the values in column C where the column B value in the same row is 1

    =SUMIF(B:B, 1 , C:C)

  3. #3
    I want to take a Count of the cells in C that are <>"" IF the corresponding cell in B=1

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try

    =SUMPRODUCT(--(B2:B20=1),--(C2:C20<>""))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Thanks XLD!

Posting Permissions

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