please help with FORMULAS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need an formula for a matrix I am building
A B C
1 600 45
2 900 55
3 650 50
4 750 60

If B is greater or = to 600 but less than or = 800 add C
ie = the answer would be 165

thanks
 
Sub tst()
Do Until ActiveCell = ""
If ActiveCell.Value >= 600 And ActiveCell.Value <= 800 Then
totl = totl + ActiveCell.Offset(0, 1)
ActiveCell.Offset(1, 0).Activate
Else
ActiveCell.Offset(1, 0).Activate
End If
Loop
MsgBox totl

End Sub

HTH

Devin
 

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