need (if X=Y, then "yes") formula

K

Kyli

Hi there,
I need to know the formula when doing a compare such as:

if A=B, then "yes", else "no

I'm not sure where the appropriate parenthesis and quotes
go on that formula.
Thanks for your help.
Kyli
 
A

Aladin Akyurek

=IF(A2=B2,"Yes","No")

which tests whether the value in A2 is equal to the value in B2. When they
are equal, we get Yes, otherwise No.
 
D

Dave R.

You've got it there. you can always look in Help with F1, and type in IF

it would be for example

=IF(A1=B1,"Yes","No")

"Yes" and "No" can be text strings or formulas, or references to other
cells, e.g.
=IF(A1=B1,A1+B1,"Not equal!")
or
=IF(A1=B1,A1,"Not equal!")
which would show the value of A1 if it's equal to B1.
 
N

Norman Harker

Hi Kyli!

=IF(A1=B1,"Yes","No")

The IF function uses the syntax:

=IF(logical_test,value_if_true,value_if_false)

The logical test must evaluate to true or false
value_if_true is the value that is returned if logical_test is TRUE
value_if_false is optional and states the value to be returned if the
logical_test is false. If omitted and the logical_test is false the
function returns FALSE.



--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 

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