Leave a cell blank if condition is false

Simon de Vegt picture Simon de Vegt · May 19, 2015 · Viewed 64.1k times · Source

Other questions have touched on this and offered solutions that are not viable for a very large data set. I have a formula like the following across 9 columns:

=IF(A1=A2, B2, "zz") 

I then autofill about 3.5 million cells + copy -> paste values. Then I find and replace "zz" with "empty cell". However, finding and replacing a million or so "zz" strings is a very slow process. I'd rather not write anything there in the first place. So my question is, how to I write the following formula:

=IF(A1=A2, B2, 'leave cell alone and write nothing there at all')

Excel seems to be incapable of not touching a cell in case of FALSE (or TRUE for that matter).

Answer

teylyn picture teylyn · May 19, 2015

The fact that the cell contains a formula already means that it is not truly empty. Common practice is to use an empty string, like

=IF(A1=A2, B2,"")

There are not many situations where this will be problematic, and if a problem arises, in most cases there are different techniques that can be applied.