+ Reply to Thread
Results 1 to 4 of 4

HELP Subtracting averages when some cells have no values

  1. #1
    Registered User
    Join Date
    01-03-2012
    Location
    Frederick, MD
    MS-Off Ver
    Excel 2007
    Posts
    4

    HELP Subtracting averages when some cells have no values

    Below I have provided an example of what I am looking for. Basically I need to subtract two averages. Average of Rows 2-100 minus the average of row 1. Row 1 will be subtracted from the average of every other row. Here is the tricky part if for example row 3 does not have a value in cell B3 or C3 then I need the average of row 1 to exclude B1 and C1 from its calculation.

    A B C
    1 - 69.1 72 71

    2 - 85 83 84 this would be the average of 85,83,84(84) minus the average of 69.1,72,71(70.7) result should be 84-70.7=13.3
    3 - 86 this would be the average of 86(86) minus the average of 69.1(69.1) result should be 86-69.1=16.9
    4 - 87 90 this would be the average of 87,90(88.5) minus the average of 69.1,72(70.55) result should be 88.5-70.55=17.95

    Please help. All suggestions are appreciated.
    Attached Files Attached Files
    Last edited by ztaylor0; 03-26-2013 at 08:11 PM.

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: HELP Subtracting averages when some cells have no values

    Using your sample above:
    =AVERAGE(A2:C2)-SUMPRODUCT(SUM((A2:C2>0)*$A$1:$C$1)/SUM(--(A2:C2>0)))
    drag down

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Registered User
    Join Date
    01-03-2012
    Location
    Frederick, MD
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: HELP Subtracting averages when some cells have no values

    Awesome, Thanks for the quick response. Worked perfectly!

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: HELP Subtracting averages when some cells have no values

    slightly shorter, with fewer functions, in cell D3 and drag-filled down:

    Please Login or Register  to view this content.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

+ 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