IF.........AND......THEN function?

T

TheRobsterUK

Hi,

I am trying to create a formula that checks to see if two condition
are true and, if they are, to perform an action

e.g.

IF (Value in cell B3 = "Hello) AND (Value in cell B4 = "World") THE
(Value in cell B5 = "It Worked!")

So basically I need excel to check the values in two cells and if the
-both- equal a -text- value that I define then to print a message i
another cell.

I don't think the IF function can do this though as it only has on
logical test. I really need an IF type function with two logical tests
or an IF function with an AND to say: IF this is true AND this is als
true, then perform this action.

Anyone got any ideas?

Cheers
-Ro
 
P

Peo Sjoblom

Another way

=IF((B3="Hello")*(B4="World"),"It worked","It failed")

--


For everyone's benefit keep the discussion in the newsgroup.

Regards,

Peo Sjoblom
 
B

Bob Phillips

A variation just for the hell of it

=IF(B3&" "&B4="Hello World","It Worked","It didn 't work")
 
S

Soo Cheon Jheong

Hi,

B5: =IF(B3&B4="HelloWorld","It Worked!","")


--
Regards,
Soo Cheon Jheong
Seoul, Korea
_ _
^¢¯^
--
 
H

Harlan Grove

Bob Phillips said:
A variation just for the hell of it

=IF(B3&" "&B4="Hello World","It Worked","It didn 't work")
....

Too context dependent. If it were phrases to be checked, e.g., "a fine" and
"day", then B3 containing "a" and B4 containing "fine day" would satisfy
B3&" "&B4="a fine day" even thougn neither B3 = "a fine" nor B4 = "day". If
you have separate criteria for separate fields, it's usually a bad idea to
combine fields and criteria for a single test.
 
H

Harlan Grove

Soo Cheon Jheong said:
Hi,

B5: =IF(B3&B4="HelloWorld","It Worked!","")

What is B3 contained "HelloWo" and B4 contained "rld"? Would that really be
a match?
 

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