Hello, having trouble finding out how to say if a value in E is greater than or equal to 30 or less than or equal to 50, then take the average of the corresponding values in column H
I started with this as a formula
=IF(OR(E:E>=30,E:E<=50),AVERAGE(H:H).
I tried doing a macro to just list what cells were being used
Sub CyclicDisplacement()
Dim cycle As Range
Set cycle = Range("E:E")
If cycle >= 2 Or cycle <= 10 Then
MsgBox cycle.Address
End If
End Sub
however I ran into the error "type mismatch", and if I tried "cycle.Value", same error.
Can someone please help me designate it correctly so that I can match the corresponding E values to H values and then average the H values?
Bookmarks