+ Reply to Thread
Results 1 to 3 of 3

IF OR statement column correspondence issue

  1. #1
    Registered User
    Join Date
    08-13-2019
    Location
    US
    MS-Off Ver
    360
    Posts
    5

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

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,188

    Re: IF OR statement column correspondence issue

    No OR involved if I'm following correctly.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    edit:- Please read the forum rules regarding thread titles and code tags. https://www.excelforum.com/forum-rul...rum-rules.html

  3. #3
    Registered User
    Join Date
    08-13-2019
    Location
    US
    MS-Off Ver
    360
    Posts
    5

    Re: IF OR statement column correspondence issue

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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1