Code:
sht.cells(3,1)="=if(......)"
sht is the active sheet or worksheet you specify.

alternatively
Code:
if sht.cells(3,1)="...." then

end if