+ Reply to Thread
Results 1 to 7 of 7

I need help plotting averages of data based on multiple columns

  1. #1
    Registered User
    Join Date
    06-29-2006
    Posts
    85

    I need help plotting averages of data based on multiple columns

    so I have a sheet that I have made...
    trying to plot data
    have 3 columns of data
    RPM, MAP, AFR
    and I am tying to find an average value of AFR based on meet criteria of MAP and RPM

    example being, I want to know average AFR between RPM 4750~5250 and MAP 92.5~97.5 (essentially data centered around 5000 RPM and 95 MAP)...

    I will be doing this for multiple values...but I just need one version of the formula to be used and I will make changes to all cells necessary.
    I'm basically plotting Average values over an X/Y Axis Chart
    Charting average values, not just data points.


    Spreadsheet attached with a small ish sample set and an example of the X/Y chart I am trying to populate with Avereage AFR at various Values


    thanks in advance for all of your help
    Attached Files Attached Files
    Last edited by soundengineer; 02-12-2014 at 02:08 PM.

  2. #2
    Registered User
    Join Date
    06-29-2006
    Posts
    85

    Re: I need help plotting averages of data based on multiple columns

    can I do it all with one formula per cell in the X/Y area...or do I need to plot AFR based on MAP and RPM first, and then average the columns....

    meaning, I make a columns that displays AFR based on meeting conditions of 95 MAP and 5000 RPM, and then I average the results that are shown...

    I already know ho to use IF(AND(logical tests <=> True False),value, or show a blank using "") to get my AFR to show up in a column if it meets the requirements I set in the AND() section

    and I already know how to use Average to make each cell average the appropriate column of AFR...
    Just trying to make it so I can do a ton less typing if possible

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,837

    Re: I need help plotting averages of data based on multiple columns

    Assuming you are working in Excel 2007 or newer, it seems to me like the AVERAGEIFS() function should be able to do this for you. http://office.microsoft.com/en-us/ex...in=HA010277524
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    06-29-2006
    Posts
    85

    Re: I need help plotting averages of data based on multiple columns

    I'm having a problem using averageifs because it returns an error whenever there is a blank cell

    the data logs I am using are various lengths..so I have to calculate cells to 65535 as an example...
    all logs will have some blank spaces.....

    how do I tell it to ignore the blank spaces so it doesnt return a Div/0 answer.... meaning I only have 184 lines in the xls I put up, but sometimes it will be much longer and I need it to account for and ignore blanks at the bottom.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,837

    Re: I need help plotting averages of data based on multiple columns

    The Div/0 error is usually returned in cases where nothing in the data set meets all of the criteria. As I personally don't usually bother with error trapping, I'm not very good at it. There is the IFERROR() function that can be used =IFERROR(your function,what you want returned if your function returns an error). http://office.microsoft.com/en-us/ex...587.aspx?CTT=1

    I just noticed that your sample file is in 2003 format. Do you need this to be backward compatible with 2003 and earlier? If so, we will probably have to do something different, because IFERROR and AVERAGEIFS are not available in earlier versions of Excel.

  6. #6
    Registered User
    Join Date
    06-29-2006
    Posts
    85

    Re: I need help plotting averages of data based on multiple columns

    no... I just saved it as that..
    it can be xlsx

    it actually has to be xlsx to have enough cells for the data I am importing


    IFERROR doesnt help as theres no way to tell it to look at every cell before averaging to determine if its blank or if it can use it for the average
    Though I do use it to filter out Blank cells after the end result

    for now, I made a setup worksheet...
    tell it where the cells end..in the example..it was cell 184
    the data logs I have actually have columns to JJ
    so I also made a cell to tell it the data I want to plot...
    just happens to be RPM is Column C and MAP is Column AD and AFR is Column J

    then I used some Indirect() to fill in the formula....for now

    here is what I ended up with for 95 KPA and 5000 RPM
    Chart on a second page
    =IFERROR(AVERAGEIFS(INDIRECT("'Import Data'!"&Setup!$B$5&3):INDIRECT("'Import Data'!"&Setup!$B$5&Setup!$B$6),INDIRECT("'Import Data'!"&Setup!$B$4&3):INDIRECT("'Import Data'!"&Setup!$B$4&Setup!$B$6),">"&AVERAGE(Chart!$A2:$A3),INDIRECT("'Import Data'!"&Setup!$B$4&3):INDIRECT("'Import Data'!"&Setup!$B$4&Setup!$B$6),"<"&AVERAGE(Chart!$A1:$A2),INDIRECT("'Import Data'!"&Setup!$B$3&3):INDIRECT("'Import Data'!"&Setup!$B$3&Setup!$B$6),">"&AVERAGE(K$19:L$19),INDIRECT("'Import Data'!"&Setup!$B$3&3):INDIRECT("'Import Data'!"&Setup!$B$3&Setup!$B$6),"<"&AVERAGE(L$19:M$19)),"")


    have to change a little bit of it for the corners and edges of the table as there is no cell above/below the edges for the </> portions...and I dont want it to treat them as 0.....
    but thats not hard.. just means I leave out a > portion and a < portion on some cells.
    Last edited by soundengineer; 02-12-2014 at 07:18 PM.

  7. #7
    Registered User
    Join Date
    06-29-2006
    Posts
    85

    Re: I need help plotting averages of data based on multiple columns

    after some playing around.. and saving the file as a .xlsm (because I added a macro to import the csv files into a separate sheet from the X/Y Chart)
    I was able to take the formula and everywhere that is says Setup!$B$6 I was able to replace with 1048576.....AVERAGEIFS must only have the blank space issue in xls format....seems to be working perfect now


    thank you for the help....
    now to work on some other versions of tables I need to chart.

+ 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] Weighted Averages an multiple columns
    By Butcher1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2013, 01:41 PM
  2. plotting multiple data columns on different graphs (same style) with a loop?
    By chemeng1T3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-07-2012, 07:42 AM
  3. Averages across multiple Columns
    By Simon M in forum Excel General
    Replies: 5
    Last Post: 04-29-2011, 02:21 AM
  4. Replies: 1
    Last Post: 05-02-2008, 10:41 AM
  5. [SOLVED] Plotting data across columns
    By John Sawyer in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-18-2005, 10:05 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