ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Limit or Exclude cells in Average and Sum formula (https://www.excelbanter.com/excel-worksheet-functions/34276-limit-exclude-cells-average-sum-formula.html)

dagger

Limit or Exclude cells in Average and Sum formula
 

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


--
dagger
------------------------------------------------------------------------
dagger's Profile: http://www.excelforum.com/member.php...o&userid=24996
View this thread: http://www.excelforum.com/showthread...hreadid=385228


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.

--
HTH

Bob Phillips

"dagger" wrote in
message ...

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


--
dagger
------------------------------------------------------------------------
dagger's Profile:

http://www.excelforum.com/member.php...o&userid=24996
View this thread: http://www.excelforum.com/showthread...hreadid=385228




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)



"dagger" wrote in
message ...

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


--
dagger
------------------------------------------------------------------------
dagger's Profile:
http://www.excelforum.com/member.php...o&userid=24996
View this thread: http://www.excelforum.com/showthread...hreadid=385228




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?


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=385228



All times are GMT +1. The time now is 11:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com