ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   please help with FORMULAS (https://www.excelbanter.com/excel-programming/318912-please-help-formulas.html)

Boogie

please help with FORMULAS
 
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

JE McGimpsey

please help with FORMULAS
 
One way:

=SUMPRODUCT(--(B1:B4<=800),--(B1:B4=600),C1:C4)


In article ,
boogie wrote:

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


DMoney

please help with FORMULAS
 
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

"boogie" wrote:

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



All times are GMT +1. The time now is 08:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com