Help ('IF' Statements) Please !!

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

Is it possible to use an if statement when the reference
cell is a Text value.

Cell a2 is 'Yes'
If(A2=yes,0,A3)
 
Yes.

Try:
If(A2="yes",0,A3)

The text you are testing against must either be in quotations or in a cell,
e.g.

In A4 put, Yes, the the formula becomes

If(A2=A4,0,A3)

--

Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"
 
Hi Craig, you can use IIF or IF as follows.

'-- code -------------------------------
Answer = IIf([A2].Value = "yes", 0, [A3].Value)
MsgBox Answer
'---------------------------------------

'-- code -------------------------------
If [A2].Value = "yes" Then
Answer = 0
Else
Answer = [A3].Value
End If
MsgBox Answer
'---------------------------------------


--
Kind Regards
Colo
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Colo of 'The Road of The Cell Masters' :)

URL:http://www.interq.or.jp/sun/puremis/colo/CellMastersLink.htm
mailto:[email protected]

/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
 
Back
Top