Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rda rda is offline
external usenet poster
 
Posts: 4
Default Need help with range value calculation

I am looking for a formula that would allow me to calculate a maximum of the
last 4 numeric values in a row divided by their count. For example:

A B C D E F G H I J
1 34 43 30 36 42 44 32
2 82 22 14
3 22 32 44 44 32 12 44 18 22

With the values in the cells displayed I would need a formula to get the
results in the following cells:

4 34 38 35 35 35 35 37 37 38 38
5 82 52 39 39 39 39
6 22 27 32 35 38 33 33 26 24

The results will be used in another worksheet for additional calculations as
needed.

The formula I came up with are as follows:
A4: =A1
B4: =IF(COUNT($A$1:B1)0,INT(SUM($A$1:B1)/COUNT($A$1:B1)),"")
C4: =IF(COUNT($A$1:C1)0,INT(SUM($A$1:C1)/COUNT($A$1:C1)),"")
D4: =IF(COUNT($A$1:D1)0,INT(SUM($A$1:D1)/COUNT($A$1:D1)),"")

This is where I'm stuck. If a value existed in D1 and a value in E1 then
the calculation should not include A1. In this instance there is no value in
either and E4 will have the same result as D4. Once we get to G1 then A1
must be dropped but the remaining need to be summed and divided by 4 with the
results in G4.

I hope I've explained my problem well and someone can come up with a simple
solution.

Thanks,
RDA
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 37
Default Need help with range value calculation

Remove the dollar signs from the formula in cell D4 and copy this formula
across to all cells to the right of D4.


"rda" wrote in message
...
I am looking for a formula that would allow me to calculate a maximum of
the
last 4 numeric values in a row divided by their count. For example:

A B C D E F G H I J
1 34 43 30 36 42 44 32
2 82 22 14
3 22 32 44 44 32 12 44 18 22

With the values in the cells displayed I would need a formula to get the
results in the following cells:

4 34 38 35 35 35 35 37 37 38 38
5 82 52 39 39 39 39
6 22 27 32 35 38 33 33 26 24

The results will be used in another worksheet for additional calculations
as
needed.

The formula I came up with are as follows:
A4: =A1
B4: =IF(COUNT($A$1:B1)0,INT(SUM($A$1:B1)/COUNT($A$1:B1)),"")
C4: =IF(COUNT($A$1:C1)0,INT(SUM($A$1:C1)/COUNT($A$1:C1)),"")
D4: =IF(COUNT($A$1:D1)0,INT(SUM($A$1:D1)/COUNT($A$1:D1)),"")

This is where I'm stuck. If a value existed in D1 and a value in E1 then
the calculation should not include A1. In this instance there is no value
in
either and E4 will have the same result as D4. Once we get to G1 then A1
must be dropped but the remaining need to be summed and divided by 4 with
the
results in G4.

I hope I've explained my problem well and someone can come up with a
simple
solution.

Thanks,
RDA


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rda rda is offline
external usenet poster
 
Posts: 4
Default Need help with range value calculation

That was the simple solution and it would work if all cells had a value. But
in this case what I need to do is determine the last 4 cells that have a
value and divide it by 4. For example: Cells A1:C1 have values, cells D1:E1
do not, cells F1:G1 have values. The results calculation for B4 would be
A1(34)+B1(43)/2, C4 would be A1(34)+B1(43)+C1(30)/3, D4 and E4 would both be
the same as C4 since no value existed in D1 or E1, F4 would be
A1(34)+B1(43)+C1(30)+F1(36)/4, G4 would be B1(43)+C1(30)+F1(36)+G1(42)/4,
...., and J4 would be F1(36)+G1(42)+I1(44)+J1(32).

Any ideas how to accomplish this with a formula calculation?

Thanks in advance,
rda

"Castell" wrote:

Remove the dollar signs from the formula in cell D4 and copy this formula
across to all cells to the right of D4.


"rda" wrote in message
...
I am looking for a formula that would allow me to calculate a maximum of
the
last 4 numeric values in a row divided by their count. For example:

A B C D E F G H I J
1 34 43 30 36 42 44 32
2 82 22 14
3 22 32 44 44 32 12 44 18 22

With the values in the cells displayed I would need a formula to get the
results in the following cells:

4 34 38 35 35 35 35 37 37 38 38
5 82 52 39 39 39 39
6 22 27 32 35 38 33 33 26 24

The results will be used in another worksheet for additional calculations
as
needed.

The formula I came up with are as follows:
A4: =A1
B4: =IF(COUNT($A$1:B1)0,INT(SUM($A$1:B1)/COUNT($A$1:B1)),"")
C4: =IF(COUNT($A$1:C1)0,INT(SUM($A$1:C1)/COUNT($A$1:C1)),"")
D4: =IF(COUNT($A$1:D1)0,INT(SUM($A$1:D1)/COUNT($A$1:D1)),"")

This is where I'm stuck. If a value existed in D1 and a value in E1 then
the calculation should not include A1. In this instance there is no value
in
either and E4 will have the same result as D4. Once we get to G1 then A1
must be dropped but the remaining need to be summed and divided by 4 with
the
results in G4.

I hope I've explained my problem well and someone can come up with a
simple
solution.

Thanks,
RDA


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 256
Default Need help with range value calculation

Try...

B4, confirmed with CONTROL+SHIFT+ENTER, and copied across:

=AVERAGE(INDEX($A1:B1,LARGE(IF($A1:B1<"",COLUMN($ A1:B1)-COLUMN($A1)+1),M
IN(4,COUNT($A1:B1)))):B1)

Hope this helps!

In article ,
rda wrote:

That was the simple solution and it would work if all cells had a value. But
in this case what I need to do is determine the last 4 cells that have a
value and divide it by 4. For example: Cells A1:C1 have values, cells D1:E1
do not, cells F1:G1 have values. The results calculation for B4 would be
A1(34)+B1(43)/2, C4 would be A1(34)+B1(43)+C1(30)/3, D4 and E4 would both be
the same as C4 since no value existed in D1 or E1, F4 would be
A1(34)+B1(43)+C1(30)+F1(36)/4, G4 would be B1(43)+C1(30)+F1(36)+G1(42)/4,
..., and J4 would be F1(36)+G1(42)+I1(44)+J1(32).

Any ideas how to accomplish this with a formula calculation?

Thanks in advance,
rda

"Castell" wrote:

Remove the dollar signs from the formula in cell D4 and copy this formula
across to all cells to the right of D4.


"rda" wrote in message
...
I am looking for a formula that would allow me to calculate a maximum of
the
last 4 numeric values in a row divided by their count. For example:

A B C D E F G H I J
1 34 43 30 36 42 44 32
2 82 22 14
3 22 32 44 44 32 12 44 18 22

With the values in the cells displayed I would need a formula to get the
results in the following cells:

4 34 38 35 35 35 35 37 37 38 38
5 82 52 39 39 39 39
6 22 27 32 35 38 33 33 26 24

The results will be used in another worksheet for additional calculations
as
needed.

The formula I came up with are as follows:
A4: =A1
B4: =IF(COUNT($A$1:B1)0,INT(SUM($A$1:B1)/COUNT($A$1:B1)),"")
C4: =IF(COUNT($A$1:C1)0,INT(SUM($A$1:C1)/COUNT($A$1:C1)),"")
D4: =IF(COUNT($A$1:D1)0,INT(SUM($A$1:D1)/COUNT($A$1:D1)),"")

This is where I'm stuck. If a value existed in D1 and a value in E1 then
the calculation should not include A1. In this instance there is no
value
in
either and E4 will have the same result as D4. Once we get to G1 then A1
must be dropped but the remaining need to be summed and divided by 4 with
the
results in G4.

I hope I've explained my problem well and someone can come up with a
simple
solution.

Thanks,
RDA


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
rda rda is offline
external usenet poster
 
Posts: 4
Default Need help with range value calculation

Thank you Domenic... it works perfectly.

"Domenic" wrote:

Try...

B4, confirmed with CONTROL+SHIFT+ENTER, and copied across:

=AVERAGE(INDEX($A1:B1,LARGE(IF($A1:B1<"",COLUMN($ A1:B1)-COLUMN($A1)+1),M
IN(4,COUNT($A1:B1)))):B1)

Hope this helps!

In article ,
rda wrote:

That was the simple solution and it would work if all cells had a value. But
in this case what I need to do is determine the last 4 cells that have a
value and divide it by 4. For example: Cells A1:C1 have values, cells D1:E1
do not, cells F1:G1 have values. The results calculation for B4 would be
A1(34)+B1(43)/2, C4 would be A1(34)+B1(43)+C1(30)/3, D4 and E4 would both be
the same as C4 since no value existed in D1 or E1, F4 would be
A1(34)+B1(43)+C1(30)+F1(36)/4, G4 would be B1(43)+C1(30)+F1(36)+G1(42)/4,
..., and J4 would be F1(36)+G1(42)+I1(44)+J1(32).

Any ideas how to accomplish this with a formula calculation?

Thanks in advance,
rda

"Castell" wrote:

Remove the dollar signs from the formula in cell D4 and copy this formula
across to all cells to the right of D4.


"rda" wrote in message
...
I am looking for a formula that would allow me to calculate a maximum of
the
last 4 numeric values in a row divided by their count. For example:

A B C D E F G H I J
1 34 43 30 36 42 44 32
2 82 22 14
3 22 32 44 44 32 12 44 18 22

With the values in the cells displayed I would need a formula to get the
results in the following cells:

4 34 38 35 35 35 35 37 37 38 38
5 82 52 39 39 39 39
6 22 27 32 35 38 33 33 26 24

The results will be used in another worksheet for additional calculations
as
needed.

The formula I came up with are as follows:
A4: =A1
B4: =IF(COUNT($A$1:B1)0,INT(SUM($A$1:B1)/COUNT($A$1:B1)),"")
C4: =IF(COUNT($A$1:C1)0,INT(SUM($A$1:C1)/COUNT($A$1:C1)),"")
D4: =IF(COUNT($A$1:D1)0,INT(SUM($A$1:D1)/COUNT($A$1:D1)),"")

This is where I'm stuck. If a value existed in D1 and a value in E1 then
the calculation should not include A1. In this instance there is no
value
in
either and E4 will have the same result as D4. Once we get to G1 then A1
must be dropped but the remaining need to be summed and divided by 4 with
the
results in G4.

I hope I've explained my problem well and someone can come up with a
simple
solution.

Thanks,
RDA




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 256
Default Need help with range value calculation

You're welcome! Thanks for the feedback!

In article ,
rda wrote:

Thank you Domenic... it works perfectly.

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
Lookup value in range, then if that value is something do a calculation. Richhall Excel Worksheet Functions 3 October 8th 07 11:06 AM
Calculation in Date Range tqm1 Excel Discussion (Misc queries) 1 June 29th 07 07:42 AM
range calculation help Mike Daniels Excel Worksheet Functions 1 January 23rd 07 12:12 AM
Date Range Calculation KC Excel Discussion (Misc queries) 5 July 31st 06 11:11 PM
Calculation of a number in a range Krista Excel Worksheet Functions 6 July 5th 06 11:12 PM


All times are GMT +1. The time now is 01:19 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"