#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 57
Default Average IF?

Hello Again,

I am looking for a formula for cell S35 that will do three things:
1-If S7 & S23 are both 0's, show a 0
2-Add (S11*S7)+(S23*S19) divided by S31
3-If either S7 or S19 are zeros, then it needs act as if they are 1's for
the formula

I hope this makes sense? The forluma that I came up wth is:
=SUM(IF(S23+S11<0,((S11*S7)+(S23*S19))/S31))
The problem is that the amount in S11 is counted as 0 (since S7 is a 0) and
provides an incorrect average amount in S35.

See below for sample:

R S
4 Set #1
5 4/3/2009
6
7 Complete Rehabs 0.00
8 Average Rehabs 2.60
9 Complete Demos 1.00
10 Average Demos 2.28
11 Cost Per Rehab $337.92
12
13 Average Per Unit $917.49
14
15
16 Set #2
17 4/3/2009
18
19 Complete Rehabs 5.00
20 Average Rehabs 3.20
21 Complete Demos 0.00
22 Average Demos 3.00
23 Cost Per Rehab $720.90
24
25 Average Per Unit $932.45
26
27
28 Totals
29 4/3/2009
30
31 Complete Rehabs 5.00
32 Average Rehabs 5.80
33 Complete Demos 1.00
34 Average Demos 5.28
35 Cost Per Rehab $788.48 (This is the correct amount, not what the
formula calculates)

Any help would be greatly appreciated!

Scott A
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,520
Default Average IF?

Scott

Try using the MAX() inbetween for getting values from S7 and S19..as below

=SUM(IF(S23+S11<0,((S11*MAX(1,S7))+(S23*MAX(1,S19 )))/S31))

If this post helps click Yes
---------------
Jacob Skaria


"Scott A" wrote:

Hello Again,

I am looking for a formula for cell S35 that will do three things:
1-If S7 & S23 are both 0's, show a 0
2-Add (S11*S7)+(S23*S19) divided by S31
3-If either S7 or S19 are zeros, then it needs act as if they are 1's for
the formula

I hope this makes sense? The forluma that I came up wth is:
=SUM(IF(S23+S11<0,((S11*S7)+(S23*S19))/S31))
The problem is that the amount in S11 is counted as 0 (since S7 is a 0) and
provides an incorrect average amount in S35.

See below for sample:

R S
4 Set #1
5 4/3/2009
6
7 Complete Rehabs 0.00
8 Average Rehabs 2.60
9 Complete Demos 1.00
10 Average Demos 2.28
11 Cost Per Rehab $337.92
12
13 Average Per Unit $917.49
14
15
16 Set #2
17 4/3/2009
18
19 Complete Rehabs 5.00
20 Average Rehabs 3.20
21 Complete Demos 0.00
22 Average Demos 3.00
23 Cost Per Rehab $720.90
24
25 Average Per Unit $932.45
26
27
28 Totals
29 4/3/2009
30
31 Complete Rehabs 5.00
32 Average Rehabs 5.80
33 Complete Demos 1.00
34 Average Demos 5.28
35 Cost Per Rehab $788.48 (This is the correct amount, not what the
formula calculates)

Any help would be greatly appreciated!

Scott A

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A formula to AVERAGE IF but only average a set number of values [email protected] Excel Worksheet Functions 2 January 31st 08 08:28 PM
Find monthly average but have average automatically configured kimbafred Excel Discussion (Misc queries) 2 August 8th 07 12:28 AM
Error Handling #N/A with AVERAGE Function - Average of values in Row Sam via OfficeKB.com Excel Worksheet Functions 13 July 31st 05 03:59 PM
Weighed Average of a weiged average when there are blanks krl - ExcelForums.com Excel Discussion (Misc queries) 1 July 6th 05 07:37 PM
how does one convert text to a formula "average(A:A)" to =average( phshirk Excel Worksheet Functions 4 April 14th 05 01:20 AM


All times are GMT +1. The time now is 04:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"