Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define a non continuous range in COUNTIF

Tags:

excel

formula

   A    B   C

1  Β        Β
2  Β        Β
3  Α        Α
4  Α        Α
5  Β        Β
6  Α        Α
7  Α        B
8  Β        Β
9  Β        Β
10 Α        Α
11 Β        A
12 Α        Α
13 Α        Α
14 Β        Β
15 Α        Α
16 Β    ??  

In cell B16 I want to count how many "B"s (the value in A16) are in cells C1:C15 and A16. Then using some function I will put an "A" or "B" in cell C16. How can I give such a range in COUNTIF? The same formula must be used for every cell in column B.

like image 472
George Dontas Avatar asked Dec 07 '11 19:12

George Dontas


People also ask

Can we create a non-contiguous cells range?

Hi, Yes you can, all you do is select your first cell then hold down the CTRL key and click in each of the other cells until they are all selected. Right click|Name a range and give it a name and you're done.

What is a non-contiguous range in Excel?

A non-contiguous range consists of two or more separate blocks of cells. These blocks can be separated by rows or columns as shown by the ranges A1 to A5 and C1 to C5.


1 Answers

Here's the formula for cell B16: =SUM(COUNTIF(INDIRECT({"C1:C15","A16"}),"B"))

like image 178
Rachel Hettinger Avatar answered Oct 29 '22 08:10

Rachel Hettinger