Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

Calculating the Average of Subtotals in Excel with a formula

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
lindemrm
Asked:
lindemrm
1 Solution
 
Saqib Husain, SyedEngineerCommented:
Try these formulas for sum and count respectively

=SUMPRODUCT((RIGHT(A2:A16575,5)<>"Total")*D2:D16575)
=SUMPRODUCT((RIGHT(A3:A16576,5)<>"Total")*1)
1
 
lindemrmAuthor Commented:
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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now