+ Reply to Thread
Results 1 to 7 of 7

average whole column if header matches criteria

  1. #1
    Registered User
    Join Date
    09-22-2014
    Location
    England
    MS-Off Ver
    MS 365 Enterprise V2210
    Posts
    85

    average whole column if header matches criteria

    Hi, This is my first post! So bear with me!

    I have a list of people names and i want to be able to get the average of each by changing the drop down in C15. So I was hoping to have the formula running over all the table.
    So that if I pick John i will get the average figure for all the number under John header.

    Thanks. I have attached my file.
    Attached Files Attached Files

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: average whole column if header matches criteria

    Hi.

    =AVERAGE(INDEX(A2:I11,,MATCH(C15,A1:I1,0)))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: average whole column if header matches criteria

    =AVERAGE(INDEX($A$2:$I$11,,MATCH($C15,$A$1:$I$1,0)))
    Try this formula
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: average whole column if header matches criteria

    in d15
    =AVERAGE(INDEX($A$1:$I$11,0,MATCH($C$15,$A$1:$I$1,0)))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: average whole column if header matches criteria

    Try with the below array formula to be entered with ctrl+shift+enter

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

  6. #6
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: average whole column if header matches criteria

    Hi,

    Using your example

    =AVERAGE(INDEX(A2:I2,MATCH(C15,A1:I1,0)):INDEX(A11:I11,MATCH(C15,A1:I1,0)))

    Where

    A1:I1 contains the header
    A2:I2 contains the first row of data
    A11:I11 contains the last row of data
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  7. #7
    Registered User
    Join Date
    09-22-2014
    Location
    England
    MS-Off Ver
    MS 365 Enterprise V2210
    Posts
    85

    Re: average whole column if header matches criteria

    OMG thanks everyone, so impressed with the speed and accuracy.
    ill defo be using this page alot more.
    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VLOOKUP returns column where column header matches another cell
    By bridge4444 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-10-2014, 11:23 AM
  2. Replies: 1
    Last Post: 10-05-2013, 03:35 PM
  3. Take average of a row that matches criteria of another cell
    By smockpuv in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-15-2013, 02:49 PM
  4. [SOLVED] Find Average, Return Column Header of Number Closest To Average
    By djmyers in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-07-2013, 04:19 PM
  5. Get the column Header where value matches in multible columns
    By paddudommeti in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-30-2013, 03:36 AM

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