+ Reply to Thread
Results 1 to 6 of 6

Average and Conditions

  1. #1
    Registered User
    Join Date
    12-23-2008
    Location
    missouri
    Posts
    5

    Average and Conditions

    hey guys

    Im pretty new to Excel but have been picking it up pretty well. I am creating a quarterly report for a medical facility and kinda stuck. I have a column that has two types of conditions (say A & B) and then a couple columns over i have 3 columns that all have numbers in them. On a seperate sheet i am trying to get an overall average of all the numbers in these three columns if they match a certain condition(A of B)

    therefore, i am trying to get the averages of all three numbers from the columns on all the patients as long as they meet the condition in the previous column.

    I hope this makes sense and please email if you think you can help but need further information.

    ggutier49@gmail.com
    Last edited by VBA Noob; 12-23-2008 at 03:23 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    Let's say the condition is in column A and the numbers in D,E and F. You can use a formula like this

    =AVERAGE(IF(A2:A100="A",D2:F100))

    This is an array formula that needs to be confirmed with CTRL+SHIFT+ENTER so that curly braces like { and } appear around the formula in the formula bar.

    Note: if there are any blanks in the number range then these will be treated like zeroes and may give a false average. To counteract that you could change the formula as follows

    =AVERAGE(IF(A2:A100="A",IF(D2:F100,D2:F100)))

  3. #3
    Registered User
    Join Date
    12-23-2008
    Location
    missouri
    Posts
    5
    is the condition in the double quotations?

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    Yes that's right, if the condition is text then that would be in quotes, if it's numeric then you don't need quotes

  5. #5
    Registered User
    Join Date
    12-23-2008
    Location
    missouri
    Posts
    5
    What about since its on a different worksheet? The numbers are on Sheet 1 and the cell i want the data in is on sheet 5

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    To reference another sheet you just add the sheet name to the referenced range like this

    'Sheet1'!A2:A100

+ 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