IF OR statement column correspondence issue

1. IF OR statement column correspondence issue

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
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?

2. Re: IF OR statement column correspondence issue

No OR involved if I'm following correctly.

Formula:
`Please Login or Register  to view this content.`

3. Re: IF OR statement column correspondence issue

Jason, you're right. Thanks for the help, wasn't familiar with that formula!

There are currently 1 users browsing this thread. (0 members and 1 guests)