Solved

Calculating the Average of Subtotals in Excel with a formula

Posted on 2016-07-27
2
75 Views
Last Modified: 2016-07-27
2015_Orders_upload.xls

So I have a list of orders which have several line items.  I want to subtotal the orders so I can get an accurate count of the number of orders, then also get the average number of books per order and the average number of titles per order.

I was trying to do this with a sumif, then get an average using countif, but I can't get the sumif statement to work.  I was wanting to have it add the values if their formulas contained "=subtotal" to eliminate all of the other data.

I saw another post where someone did this as a macro, but when I tried to use that, I kept getting an 'out of memory' error unless I only did like 100 rows at a time.  With 15,000 rows, that seemed a bit tedious.

Any suggestions?
0
Comment
Question by:lindemrm
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 41732369
Try these formulas for sum and count respectively

=SUMPRODUCT((RIGHT(A2:A16575,5)<>"Total")*D2:D16575)
=SUMPRODUCT((RIGHT(A3:A16576,5)<>"Total")*1)
1
 

Author Comment

by:lindemrm
ID: 41732386
That's a different was to approach it, but it sure is simple and works.  Thank you.  I feel like kind of a schmuck for not coming up with that one on my own.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now