+ Reply to Thread
Results 1 to 5 of 5

Average Column IF Column Header Has Specific Text

  1. #1
    Registered User
    Join Date
    04-30-2010
    Location
    washington dc
    MS-Off Ver
    Excel 2007
    Posts
    51

    Average Column IF Column Header Has Specific Text

    Hi.

    Okay. I have a spreadsheet that is an array, with Column and Row Headers, and data. I need a formula which searches across the column headers, finds a column header with specific text, and then averages all data in the column that is >0. I have attached an example sheet so you can see what I am trying to accomplish. I have a feeling there is an easy solution, but I just can't seem to get my head to work right today.

    JacobColumn Average Example.xlsx

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Average Column IF Column Header Has Specific Text

    Hi Jgray,


    You can use the below formula :-

    =AVERAGE(IF(data<>0,data,""))

    Where data is a defined name with formula:-
    =OFFSET(Sheet1!$A$2:$A$16,0,MATCH(Sheet1!D$22,Sheet1!$B$1:$L$1,0))

    drag the formula to right side to achieve the desired results to match up with headings.

    sample file.

    Column Average Example.xlsx
    regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    04-25-2012
    Location
    portsmouth,england
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Average Column IF Column Header Has Specific Text

    use the averageif formula with the if formula, so like:
    =IF(A1=C22;AVERAGEIF(A2:A16;">0");IF(B1=C22;AVERAGEIF(B2:B16;">0");""))
    and so on
    It would be much easier with a code though, do you have any experience with them?

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    365
    Posts
    2,243

    Re: Average Column IF Column Header Has Specific Text

    Hi Jacob,

    In C24, then copy across.

    Please Login or Register  to view this content.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  5. #5
    Registered User
    Join Date
    04-30-2010
    Location
    washington dc
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: Average Column IF Column Header Has Specific Text

    Great. These both work perfectly. Thanks!

+ 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