if statement where cell is not empty

M

mattguerilla

when writing if statements, if I want a certain action when the cell is empty
i write - if(A1="","do this","do something else"). But if I want it to do
something when there is anything in the cell in question how do I write the
statement? ie, if(A1="anything","do this","do something else".

Hope I am making sense.

Matt
 
D

David Biddulph

mattguerilla said:
when writing if statements, if I want a certain action when the cell is
empty
i write - if(A1="","do this","do something else"). But if I want it to do
something when there is anything in the cell in question how do I write
the
statement? ie, if(A1="anything","do this","do something else".

Hope I am making sense.

=if(A1="","do something else","do this")

or =IF(ISBLANK(A1),"do something else","do this")
 
T

Toppers

=If(A1<>"","do this","do that")

<> means "Is not"/"Not equal to" so <>"" means "is not empty"

BUT equally

=if(A1="","do this","do something else") would also work as the "do
something else" is actioned if A1 is not empty.

HTH
 
F

FloMM2

Mattguella,
This works for a cell that is empty:
Cell A1 - blank, cell A2 - =IF(A1="", "got it!", "Aint got it!")
This works for a cell that is not empty:
Cell A2 - blank, cell B2 - =IF(A2>="", "Aint got it!","Got it!")
Good luck,
 
Top