Logical Spreadsheet Functions: IF & COUNTIF
📌 Quick Definition (Answer-First)
The IF function tests a condition and returns one result when true and another when false. COUNTIF counts how many cells in a range match a given criterion (such as scores >= 8).
How It Works & Why It Matters
IF takes 3 arguments: logical_test, value_if_true, and value_if_false.
In COUNTIF, comparison criteria with operators like ">=5" or text strings must be enclosed in double quotes.
💻 IF & COUNTIF Syntax
=IF(D2>=5, "Pass", "Fail") =COUNTIF(D2:D30, ">=8") =SUMIF(B2:B30, "CS", D2:D30)
🏫 Classroom Example
=COUNTIF(E2:E28, "Pass") counts how many students passed without manual tallying.
⚖️ COUNTIF vs. COUNT
COUNT counts all numeric cells in a range; COUNTIF counts only cells matching your specific rule.
⚠️ Common Mistake in Exams & Homework
Forgetting quotes around text outputs or comparison strings like ">=8", or mixing up comma vs. semicolon separators.
🚀 Practice in ArkyEdu Labs & Related Guides
🎮 Launch Interactive Lab →
Calcule Tabelare: Formule Aritmetice & Funcții (SUM, AVERAGE, MIN, MAX, IF, INT)
📖 Full Lesson & Curriculum →
Clasa a VIII-a · Formule & Funcții Specializate
🏫 Grade 8 Hub →
All modules & guides for this grade
📚 Excel Formulas & Error Fixes →
Complete Grade 8 spreadsheet guide for Excel & Google Sheets: master SUM, AVERAGE, IF, COUNTIF, absolute references ($A$1), semicolon vs comma syntax, and #VALUE! / #NAME? fixes.
❓ Quick Questions & Answers
Why must ">=8" be inside quotes inside COUNTIF?
Excel expects the criterion argument of COUNTIF to be evaluated as a condition string.
Related Glossary Terms
← Back to Full Glossary (A–Z)Core Excel Functions: SUM, AVERAGE, MIN, MAX →
SUM, AVERAGE, MIN, and MAX compute totals, arithmetic means, smallest values, and largest values across a cell range. Every spreadsheet formula must begin with an equals sign (=).
Common Excel Formula Errors (#NAME?, #VALUE!, #DIV/0!, #REF!, ###) →
Excel error codes diagnose exact formula issues: #NAME? means a misspelled function name, #VALUE! means mixing text with math, #DIV/0! means dividing by zero, #REF! means a deleted reference, and ### means the column is too narrow.
Conditional Branching (if / else & switch) in C++ →
Conditional branching lets a program choose between different execution paths depending on whether a logical condition is true or false (if / else), or by matching discrete constant values (switch).
Cell, Range & Absolute Reference ($A$1) in Excel →
A cell sits at a column-row intersection (like B4), and a range spans a block of cells (A2:A20). An absolute reference ($B$1) locks a cell with dollar signs so it stays fixed when dragging a formula with AutoFill.