'Google Sheets: compare cells and return TRUE/FALSE only if they are not blank

This is my first question on stackoverflow.

I would like to compare two columns of data on Google Sheets and receive a TRUE/FALSE response (=A1=B1) when A1 and B1 are not blank. The simple formula =A1=B1 gives a TRUE response when comparing two blank cells and a FALSE response if only one of them is blank. My issue is that I would like to receive:

  • a N/A response (or any third response but TRUE-FALSE) if both are blank;
  • a fourth response (could be anything but TRUE-FALSE-N/A) if only one of the two is blank.

I tried with the IF and IFS functions and not(isblank() but I got only error messages so far.

Would it be possible to achieve this on Google Sheets?

Many thanks in advance!



Solution 1:[1]

Just simply nest multiple IF expressions. Use COUNTBLANK to get number of blank cells.

Use the following formula:

=IF(COUNTBLANK(A1:B1)=0, A1=B1, IF(COUNTBLANK(A1:B1)=1, "condition4", "condition3"))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Timmy Chan