how to write a formlula that make a cell to do calcuations only if certain conditions are met, otherwise to do nothing, i.e. to retain old value of the cell