Google Sheets IF OR statement -


i've got sheet a1 either blank, number (12345), or statement ("foo'). i'd is:

if a1 blank a2 blank  or if a1 number a2 = today  or if a1 "foo" a2 = "bar" 

i've got started, , way works, need add "foo" part.

=if(isblank(a1), , today()) 

you can using nested if statements. place following in cell a2:

=if(or(isblank(a1), a1=""),"",if(isnumber(a1),today(),if(a1="foo","bar",error.type(a1)))) 

first, checks if cell blank or null string (if don't want null string part replace or(isblank(a1), a1="") isblank(a1)). if cell blank makes a2 equal empty string (note - empty string not same blank. best of knowledge there no way return "blank").

if cell not blank or null string checks see if number. if number returns current date.

if not number checks see if cell equal string "foo". if equal foo returns string "bar".

if none of statements true, returns error. may replace error.type(a1) default action want (perhaps "").

for example:

----------------------- |          |          | ----------------------- |         1| 4/27/2015| ----------------------- |foo       |bar       | ----------------------- |foobar    |   #n/a   | -----------------------