+ Reply to Thread
Results 1 to 12 of 12

Subtraction of Column Ranges within Averageifs Function

  1. #1
    Registered User
    Join Date
    02-08-2014
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    26

    Subtraction of Column Ranges within Averageifs Function

    Hi Guys,

    Always getting back to this excellent forum when I get stuck

    This time I have a situation like this:
    Column A - Dates
    Column B - Equipment Type
    Column C - Load Start Time
    Column D - Load End Time

    I need to do some statistical analysis (average, mode, medium, st dev) on the load times, which is load start time - load end time. As far as I know, I can't subtract ranges (column d i column c) within Averageifs function. I assume I would need to use an array function for this.

    Would anyone please be able to assist with this?

    Many thanks!

  2. #2
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Subtraction of Column Ranges within Averageifs Function

    You confirm AVERAGE with Control+Shift+Enter it will return the Average time beetween each row in colums C&D
    =AVERAGE(D1:D4-C1:C4)
    If you need more critera you can use
    =AVERAGE(IF(range=criteria,IF(range=criteria,D1:D4-C1:C4)))
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  3. #3
    Registered User
    Join Date
    02-08-2014
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Subtraction of Column Ranges within Averageifs Function

    Would the last one be an array formula as well?

  4. #4
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Subtraction of Column Ranges within Averageifs Function

    Yes it must be.

  5. #5
    Registered User
    Join Date
    02-08-2014
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Subtraction of Column Ranges within Averageifs Function

    Thank you so much Robert, priceless help!

  6. #6
    Registered User
    Join Date
    02-08-2014
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Subtraction of Column Ranges within Averageifs Function

    Is this formula OK:

    {=AVERAGE(IF(OR($E$2:$E$603="C",$E$2:$E$603="D",$E$2:$E$603="G",$E$2:$E$603="H"),$L$2:$L$603-$K$2:$K$603))}

    I'm asking because it's giving me the same result with A,B,E,F criteria and C,D,G,H.

  7. #7
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Subtraction of Column Ranges within Averageifs Function

    =AVERAGE(IF(ISNUMBER(SEARCH($E$2:$E$603,{"C","D","G","H"})),IF(ISNUMBER($L$2:$L$603),IF(ISNUMBER($K$2:$K$603),$L$2:$L$603-$K$2:$K$603))))

    The additional ISNUMBER is to check if all of your cells are >0 in case one of corresponding cell has been left empty
    or
    =AVERAGE(IF(ISNUMBER(SEARCH($E$2:$E$603,G2:J2)),IF(ISNUMBER($L$2:$L$603),IF(ISNUMBER($K$2:$K$603),$L$2:$L$603-$K$2:$K$603))))
    where G2:J2 holds C,D,G,H

  8. #8
    Registered User
    Join Date
    02-08-2014
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Subtraction of Column Ranges within Averageifs Function

    Your formula works! But I have just checked all the cells, non of them was empty or negative (in one instance though the difference L-K was negative). But that wouldnt realy matter right?

    Would I be able to use something like this (to make sure start date is not greater than end date, as I had such instance):

    =AVERAGE(IF(TEXT($L$2:$L$603-$K$2:$K$603,"[hh]:mm")>1,IF($E$2:$E$603="A",$L$2:$L$603-$K$2:$K$603)))

  9. #9
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Subtraction of Column Ranges within Averageifs Function

    It would as the total average would take the empty cell into account.

    This willwork if you ned average if hours beetween End/Start is >1
    =AVERAGE(IF(TEXT($L$6:$L$603-$K$6:$K$603,"[hh]:mm")>"01:00",IF($E$6:$E$603="A",$L$6:$L$603-$K$6:$K$603)))

  10. #10
    Registered User
    Join Date
    02-08-2014
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Subtraction of Column Ranges within Averageifs Function

    Thank you for that. I have tried this one:

    =AVERAGE(IF(TEXT($L$2:$L$603-$K$2:$K$603,"[hh]:mm")>"01:00",IF($E$2:$E$603="A",$L$2:$L$603-$K$2:$K$603)))

    Its giving me an error "value not available to the formula". Any clue?

    My dates are formated to show something like 27/2/2014 6:00. I want to exclude all values where the difference between the dates is less that say 10hrs, because in reality ships cant be loaded in that much time. Something like this works:

    =AVERAGE(IF($L$2:$L$603-$K$2:$K$603>0.25,IF($E$2:$E$603=U3,$L$2:$L$603-$K$2:$K$603)))

    I assume 0.25 in the instance above would be equal to 0.25x24hrs=6hrs

  11. #11
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Subtraction of Column Ranges within Averageifs Function

    Attached your workbook.

  12. #12
    Registered User
    Join Date
    02-08-2014
    Location
    Perth
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Subtraction of Column Ranges within Averageifs Function

    Thank I've solved it in the meantime.

+ 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. Subtraction of Column Ranges within Averageifs Function
    By lukazi in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2014, 04:32 AM
  2. [SOLVED] averageifs dynamic criteria ranges
    By ValGlad in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-20-2013, 12:08 PM
  3. STDEV from AVERAGEIFS using date ranges
    By BAT3 in forum Excel General
    Replies: 4
    Last Post: 05-31-2012, 07:18 PM
  4. [SOLVED] averageifs on multiple tables/ranges
    By kpkammer in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-28-2012, 12:20 PM
  5. averageifs over several ranges
    By phstol in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-06-2009, 01:18 PM

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