+ Reply to Thread
Results 1 to 11 of 11

Average of 2 coloums

Hybrid View

  1. #1
    Registered User
    Join Date
    11-22-2007
    Posts
    60

    Average of 2 coloums

    I have 2 spreadsheets showing a row of numbers that represents the number of days an order took to process.

    I want to find the average of these columns - I tried the below formula.


    =ROUND(((AVERAGE(Ttool!AI:AI)+AVERAGE(Alpha!AI:AI))/2),0)&" Days"


    Which seemed to work but now I realise that it is only correct if both columns have the same number of rows - Which they don't

    Is there a simple way of solving this without using a series of sum & count statements?

  2. #2
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    The only way that you will get a true average is to sum the 2 columns and divide the total by the sum of occurances

    i.e (sumA+SumB)/(entries in A+Entries in B)

    You can get the no of entries by using COUNTIF with a criteria of >0.

    Edit

    On second thoughts

    How about average(range a + range B)
    Last edited by EdMac; 04-03-2008 at 08:38 AM.
    Ed
    _____________________________
    Always learning, but never enough!
    _____________________________

  3. #3
    Registered User
    Join Date
    11-22-2007
    Posts
    60
    I think this should work

    =ROUND(((SUM(Thermatool!AI:AI)+SUM(Alpha!AI:AI))/((COUNT(Thermatool!AI:AI)+COUNT(Alpha!AI:AI)))),0)&" Days"

    No need for Countif as AI is always going to be a number.

    Seems to give the right answer

  4. #4
    Registered User
    Join Date
    11-22-2007
    Posts
    60
    The sumproduct doesn't seem to work.

    Currently I have 1 figure in each spreadheet

    174 in thermatool & 0 in Alpha

    This should give an answer of 87 days

    Using Sum product I get 174.

    Changing Alpha!AI Doesn't have an effect on the answer - Its just giving me an average of Thermatool(AI:AI)

  5. #5
    Registered User
    Join Date
    11-22-2007
    Posts
    60
    now changed it to both "/2"

    and with 2 figures it works fine - but as soon as one has more 2 screws up

    I have

    172
    0


    0

    Should be average of 57 but sumproduct method gives 43

    Which is (86+0)/2

    Which is the problem I had at the start.

  6. #6
    Registered User
    Join Date
    11-22-2007
    Posts
    60
    =ROUND(average(Thermatool!AI:AI,Alpha!AI:AI),0) &" Days"

    Never thought about having 2 cell references - So simple!!


    Cheers

  7. #7
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111
    Hi,

    Not knowing the cell placement

    try this

    
    =ROUND((SUMPRODUCT(AVERAGE(Ttool!AI:AI))+SUMPRODUCT(AVERAGE(Alpha!AI:AI)/2)),0)&" Days"

    Cheers

    ratcat

  8. #8
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111
    Quote Originally Posted by ratcat
    Hi,

    Not knowing the cell placement

    try this

    
    =ROUND((SUMPRODUCT(AVERAGE(Ttool!AI:AI))+SUMPRODUCT(AVERAGE(Alpha!AI:AI)/2)),0)&" Days"

    Cheers

    ratcat
    Found an error

    Please move the /2 out side of the next )

    Wrong - (Alpha!AI:AI)/2)),0)&" Days"

    Right - (Alpha!AI:AI))/2),0)&" Days"

  9. #9
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111
    Quote Originally Posted by ratcat
    Found an error

    Please move the /2 out side of the next )

    Wrong - (Alpha!AI:AI)/2)),0)&" Days"

    Right - (Alpha!AI:AI))/2),0)&" Days"

    Just touching an EdMac said about the true averages. The formula must divided by both sumproducts or none.

    
    
    =ROUND((SUMPRODUCT(AVERAGE(Ttool!AI:AI)/2)+SUMPRODUCT(AVERAGE(Alpha!AI:AI))/2),0)&" Days"
    Clear as mud ??

  10. #10
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Have you tried this


    =ROUND(average(Thermatool!AI:AI,Alpha!AI:AI),0) &" Days"

    should work and a lot more concise

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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