Two conditions in one IF statement

S

shashi1515

Can I have two conditional statements in a IF statement.

Ex: if (condition A) or (condition B) then

do this

elseif (conditions c) and (condition D) then

do this

endif


How do I write in this syntax. Please let me know.

Thanks,
Shashi
 
L

lister_d_000169

you can use the or statement in your if

=IF(OR('Cell1'=1,'Cell2'=1),"True Case","False Case")

you can do a similar thing with the AND statement as well

hope this helps

rgds

mark
 
D

Don Guillett

Sure
if range("a1")=1 or range("b1")=2 then
do this
elseif
if range("c1")=3 and range("d1")=4
do that
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top