A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Use an IF to test whether B4 is blank, and if it is not blank, count the matches between B4:Q4 and B6:Q6.
=IF(B4="",0,SUM(IF(B6:Q6=B4:Q4,1,0)))
How it works:
-
IF(B4="",0,...)returns0ifB4is empty. -
IF(B6:Q6=B4:Q4,1,0)compares each cell in row 6 to the corresponding cell in row 4. -
SUM(...)adds the matches, so each correct match contributes1.
If the goal is to return 0 unless B4 has a value, this formula matches that requirement.
Note: formulas like this that use range comparisons with SUM(IF(...)) are array formulas in the referenced guidance.
References: