Solved

Calculating the Average of Subtotals in Excel with a formula

Posted on 2016-07-27
2
56 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

A2 = A1 That kind of cell reference is relative.  If you copy it from A2 to B2, then B2 will get this: B2 = B1 That's all fine and good, but if you then insert a new row above row 2, you'll find: A3 = A1 B3 = B1 This is intentional. …
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

744 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