trbaze
asked on
If else statement
I'm trying to write an if else statement in which the action would perform if two conditions where true.
example:
If result = 2, and time = 3, then
example:
If result = 2, and time = 3, then
ASKER
Is that the way it is actually written? So that both conditions must return true on the if part of the statement. Not just one.
yes, the <condition 1> AND <condition 2> will return true only if both conditions return true.
more compelte verion:
If result = 2 and time = 3 then
'do action1
else
' do action2
end if
If result = 2 and time = 3 then
'do action1
else
' do action2
end if
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Theres some other ways.
If you just happen to care, while we're point out .net and VBA.
Excel uses an AND function. IF(AND(result=2,time=3),"W as true","Was False")
In VBA you can implement an AND by nested IFs
If Result = 2 then
if time = 3 then
'both were true
end if
end if
If you just happen to care, while we're point out .net and VBA.
Excel uses an AND function. IF(AND(result=2,time=3),"W
In VBA you can implement an AND by nested IFs
If Result = 2 then
if time = 3 then
'both were true
end if
end if
Open in new window