formula to check if two cells in excel have data code example Example: if a1='' and b1='' to check two column cells in excel =IF((AND(A1="A", B1="B")), "1", "0")