# "Reference" Cells for COUNTIF (Calc)

Hello! I have a spreadsheet with much information about my school. Specifically speaking, the names of the students occupy a column of this spreadsheet, while at the same time the other columns carry information about each student, including the elective lessons he/she has chosen to attend (for example History, Sociology, e.t.c.). Each student belongs to a group, and each group belongs to a class (year) of my school. I need to make statistics for each group, each class (year) and the whole school, for counting how many students have chosen each one of the elective lessons. It would be really useful if I could use COUNTIF by defining the "range" of cells of each group DYNAMICALLY. I mean that instead of defining directly the range of cells for COUNTIF, it would be more effective and efficient if the first and last of this "range" could be "variables" which could be stored in other cells. For example, instead of defining directly the range for the group A1 as D5:D30, I need to store the information "D5" and "D30" in other cells (for example Z1 and Z2 respectively), and address the COUNTIF to these cells (Z1 and Z2). This is highly useful, since each year the range of cells for each group changes, and this approach needs just to change the values of the cells Z1 and Z2. Is it possible to do it? How? Thanks a lot!

Of course it is possible! The best and easiest way is to use Base, not Calc. Don't be angry, this is just a joke. But in every joke there is only a fraction of a joke - everything else is true.

Thank you both for your answer and your joke! :-)