ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF statement (https://www.excelbanter.com/excel-worksheet-functions/130955-if-statement.html)

DP7

IF statement
 
Hi I would like to know if it is possible to run an IF statement and if the
condition is FALSE. It will leave the value that was previously in the cell?
Thanks in advance


Teethless mama

IF statement
 
=IF(A1="Mama","",A1)


"DP7" wrote:

Hi I would like to know if it is possible to run an IF statement and if the
condition is FALSE. It will leave the value that was previously in the cell?
Thanks in advance


David Biddulph

IF statement
 
No. If you put a formula in a cell, the formula will replace the previous
contents.

You can, of course, write the IF statement to include the previous contents
(whether formula or value), for example:
=IF(condition,new value,previous contents)
--
David Biddulph

"DP7" wrote in message
...
Hi I would like to know if it is possible to run an IF statement and if
the
condition is FALSE. It will leave the value that was previously in the
cell?
Thanks in advance




Otto Moehrbach

IF statement
 
DP7
You will need VBA to do that. A formula in a cell can only return a
value and it can return a value only to the cell in which the formula
resides.
A Worksheet_Change macro can be written to look at the new contents of a
cell and then issue an Undo command if your criteria for doing so is met.
Post back if this sounds like something you could use. HTH Otto
"DP7" wrote in message
...
Hi I would like to know if it is possible to run an IF statement and if
the
condition is FALSE. It will leave the value that was previously in the
cell?
Thanks in advance





All times are GMT +1. The time now is 09:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com