+ Reply to Thread
Results 1 to 3 of 3

AverageIF with OR in Macro

  1. #1
    Registered User
    Join Date
    08-13-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    87

    AverageIF with OR in Macro

    Hello,
    I have been trying to get this formula to work which I expected to be straightforward but for some reason I am not able to do so. The logic is to return the average of values in column A if column B has a certain value. Please see attached sheet, I want two averages;
    one when value in column B is either X or A
    and other when value is B or Z.

    Also how to write a macro for this?



    Thanks,
    Aadesh!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-13-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: AverageIF with OR in Macro

    As I am trying to get this to work, one other thing that I should point out is that the data I will be using for getting the averages would be from a list filtered based on the date. The data that you see in Sheet 1 is for 04/15/2013. When I wrote this formula
    =AVERAGEIF(AH:AH,"x",AG:AG)

    It gave me average for the entire range and not just the filtered data. I am attaching the orginial data as well in Sheet 2 of AverageIF.xlsx


    Thanks,
    Aadesh Gandhi.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    08-13-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: AverageIF with OR in Macro

    I got it to work, used another logic to get around!




    Aadesh.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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