Microsoft 365 and Office | Excel | For home | Windows
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Use an IF formula to test whether B4 and B6 is blank, and if it is not blank, count the matches between B4:Q4 and B6:Q6 otherwise leave the cell blank
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
AI answer
Use this formula:
=IF(OR(B4="",B6=""),"",SUM(IF(B4:Q4=B6:Q6,1,0)))
How it works:
IF(OR(B4="",B6=""),"",...) returns a blank if either B4 or B6 is blank.SUM(IF(B4:Q4=B6:Q6,1,0)) compares each cell in B4:Q4 with the corresponding cell in B6:Q6 and counts the matches.If a legacy array formula is required, enter the formula and confirm it with Ctrl+Shift+Enter. In current Microsoft 365 versions, pressing Enter is sufficient for dynamic array behavior.
References: