Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leave a cell blank if condition is false

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).

like image 626
macroscope Avatar asked Nov 07 '25 11:11

macroscope


1 Answers

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.

like image 99
teylyn Avatar answered Nov 09 '25 09:11

teylyn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!