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

  • Thread starter Thread starter Kyli
  • Start date Start date
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
 
=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.
 
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.
 
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.
 
Back
Top