+ Reply to Thread
Results 1 to 6 of 6

AVERAGEIFS, LARGE, and SMALL

  1. #1
    Registered User
    Join Date
    02-28-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    AVERAGEIFS, LARGE, and SMALL

    So I'm having an issue with my entire workbook. I thought I had the AVERAGE column figured out using AVERAGEIFS but it didn't work correctly, either. I have attached the workbook with my data.

    The first sheet has my OBJECTIVE data which will be calculated from values in the second sheet, the DATA SET. In the first row of data on the first sheet I have what the correct values should be for the given NAME.

    My objectives:

    LENGTH: This column needs to take the largest value in the DATA SET for the given NAME and subtract from it the smallest value for that NAME in the DATA SET, returning the total length
    AVERAGE DENSITY: This columns needs to return the average of the DENSITY values for a given NAME in the DATA SET
    DAYS: This column is much like the LENGTH column, only using the DAYS data instead of LENGTH
    COUNTY: What I would like to return in this column is an abbreviated version of the COUNTY name using the first three letters (i.e., SUS for Susquehanna)

    Any help would be appreciated, please let me know if I need to further clear any of this up.

    Dummy Data.xlsx
    Last edited by opsanalysis07; 03-20-2014 at 04:02 PM.

  2. #2
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Subtract one value from another within a column conditional on value in separate colum

    Hi
    b2 cell (is an array)
    =INDEX(Table1[Length],LARGE(IF(A2=Table1[Name],ROW(Table1[Name])-1,""),1))-INDEX(Table1[Length],SMALL(IF(A2=Table1[Name],ROW(Table1[Name])-1,""),1))

    c2 cell
    =AVERAGEIF(Table1[Name],A2,Table1[Density])

    d2 cell (is an array)
    =INDEX(Table1[Days],LARGE(IF(A2=Table1[Name],ROW(Table1[Name])-1,""),1))-INDEX(Table1[Days],SMALL(IF(A2=Table1[Name],ROW(Table1[Name])-1,""),1))

    e2 cell
    =INDEX(Table1[County],MATCH(A2,Table1[Name],0))

    If the formula is an array then hit Ctrl Shift Enter after editing formula
    Appreciate the help? CLICK *

  3. #3
    Registered User
    Join Date
    02-28-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: AVERAGEIFS, LARGE, and SMALL

    I don't know how you guys work so fast but I sure am thankful. I really appreciate your help. Will these formulas ignore blanks or will I need to add more for that?

  4. #4
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: AVERAGEIFS, LARGE, and SMALL

    For example
    if ine of the "ROSIEMAR SUS 3H" 's density numbers left blank in Data sheet Avarageif will take to calculation. Depending on how your data is set formulas may show different results. All the formulas above considers that all data is available.

  5. #5
    Registered User
    Join Date
    02-28-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: AVERAGEIFS, LARGE, and SMALL

    Ok, sounds great. Thank you, again.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,959

    Re: AVERAGEIFS, LARGE, and SMALL

    Or you could try these regular formulas, copied down...

    B2=OFFSET('Data Set'!$A$1,MATCH($A2,'Data Set'!$A:$A,0)-1+COUNTIF('Data Set'!$A:$A,$A2)-1,1) - INDEX('Data Set'!B:B,MATCH($A2,'Data Set'!$A:$A,0))
    C2=AVERAGEIF('Data Set'!$A:$A,$A2,'Data Set'!$C:$C)
    D2=OFFSET('Data Set'!$A$1,MATCH($A2,'Data Set'!$A:$A,0)-1+COUNTIF('Data Set'!$A:$A,$A2)-1,3) - INDEX('Data Set'!D:D,MATCH($A2,'Data Set'!$A:$A,0))

    edit: I hate the structured way excel uses on formulas in a table, so I just type in the values
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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] Conditional Formatting using data from separate column
    By leanne1727 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-05-2013, 01:13 PM
  2. VBA code to Subtract values in Column F with Column E if found non-blank
    By hydz1213 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2013, 04:34 AM
  3. Replies: 1
    Last Post: 01-12-2012, 07:50 PM
  4. Conditional Running Average Separate Column
    By Halo in forum Excel General
    Replies: 2
    Last Post: 10-14-2008, 09:30 PM
  5. Replies: 2
    Last Post: 06-07-2006, 10:45 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