IF, AND Formulas

  • Thread starter Thread starter candyyoung
  • Start date Start date
C

candyyoung

I am just learning Excel and I am trying to add a formula to some cell
to do multiple functions. Here is what I am trying to do: IF B1=1 an
C1=1, add "1" to A1 and delete B1 and C1. Any help out there
 
Since you are trying to change three cells you will need a macro rather than
a function. Try the following:

Sub bumpandclear()
If Cells(1, 2) = 1 And Cells(1, 3) = 1 Then
Cells(1, 1) = Cells(1, 1) + 1
Cells(1, 2) = ""
Cells(1, 3) = ""
End If
End Sub
 
You can't do that with a formula. A formula exists in one cell, and returns
a value to just one cell, and you cannot add 1 to itself.

Secondly, if you clear out B1, the formula in A1 won't work any longer.


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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

Back
Top