Limit or Exclude cells in Average and Sum formula

D

dagger

I am curious if anyone can help me out. I am trying to create both an
average and a sum formula that will limit or exclude certain fields.
Here is an example of what I'm working with:

Day1: 25
Day2: 20
Day3: 20
Day4: 25
Day5: 25
Weekly Total: 115

Day1: 15
Day2: 20
Day3: 30
Day4: 35
Day5: 25
Weekly Total: 125

Daily average= ?
Daily Total= ?

Is there any way to run an average excluding the weekly total fields
either by color or any other way. There is a SUM formula in the weekly
total field, can formula fields be excluded? The same for the average
of the daily numbers?

Thanks for any help you can provide.
Todd
 
B

Bob Phillips

=SUM(IF(A1:A100<>"Weekly Total"),B1:B100)

and

=AVERAGE(IF(A1:A100<>"Weekly Total"),B1:B100)

Both are array formulae, so commit with Ctrl-Sift-Enter.
 
N

N Harkawat

The place where you have the weekly total instead of using =SUM funciton to
compute the weekly total use
=Subtotal(9,A1:a5)
for all the Weekly totals in your sheet

Then for Daily total at the end use
=subtotal(9,A1:a9999)
and for the daily average
=subtotal(1,a1:a9999)
 
S

swatsp0p

You can use SUMIF and COUNTIF to find your averages, as such:

Assuming your data is in A1:B13 use this formula to find the Average:

=SUMIF(A1:A13,"=DAY*",(B1:B13))/COUNTIF(A1:A13,"=DAY*")

and this give the total of all of the days:

=SUMIF(A1:A13,"=DAY*",(B1:B13))

Of course modify your ranges to meet your needs.

Does this work for you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top