Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default ... I need some help with a formula ...

I have a column of data (A2:A53) which represent 2007 week ending dates,
(linked to cells of 52 worksheets).

I have a column of Data (B2:B53) which represents the hours worked for each
week, (also linked to cells of 52 worksheets). For weeks not worked yet, the
value is zero, (right now there are zeros in cells B13:B53).

I would like the average of the hours worked for the entire year, and I
would like the average of the hours worked between Cell B7 and B53.

If there were no zero's I could use the following formulas:

=(SUM(B2:B53))/(COUNT(A2:A53))
=(SUM(B7:B53))/(COUNT(A7:A53))

I think I should use a couple of if statements something like <<< IF a some
cells are =0, subtract the count from the ranges in the formulas , But I
don't know how to state this in Excel terms.

Can someone give me a hand?

Thanks
Darrell
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default ... I need some help with a formula ...

In this respect the dates are irrelevant, you simply need to average the
numbers that are greater then 0 so try

=(SUM(B2:B53))/(COUNTIF(B2:B53,"0"))

for the average of B7 to B53 simply change B2 in the above formula to B7.

Mike

"Dr. Darrell" wrote:

I have a column of data (A2:A53) which represent 2007 week ending dates,
(linked to cells of 52 worksheets).

I have a column of Data (B2:B53) which represents the hours worked for each
week, (also linked to cells of 52 worksheets). For weeks not worked yet, the
value is zero, (right now there are zeros in cells B13:B53).

I would like the average of the hours worked for the entire year, and I
would like the average of the hours worked between Cell B7 and B53.

If there were no zero's I could use the following formulas:

=(SUM(B2:B53))/(COUNT(A2:A53))
=(SUM(B7:B53))/(COUNT(A7:A53))

I think I should use a couple of if statements something like <<< IF a some
cells are =0, subtract the count from the ranges in the formulas , But I
don't know how to state this in Excel terms.

Can someone give me a hand?

Thanks
Darrell

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default ... I need some help with a formula ...

Mike:

Thank you, this was nice and simple.

Darrell

"Dr. Darrell" wrote:

I have a column of data (A2:A53) which represent 2007 week ending dates,
(linked to cells of 52 worksheets).

I have a column of Data (B2:B53) which represents the hours worked for each
week, (also linked to cells of 52 worksheets). For weeks not worked yet, the
value is zero, (right now there are zeros in cells B13:B53).

I would like the average of the hours worked for the entire year, and I
would like the average of the hours worked between Cell B7 and B53.

If there were no zero's I could use the following formulas:

=(SUM(B2:B53))/(COUNT(A2:A53))
=(SUM(B7:B53))/(COUNT(A7:A53))

I think I should use a couple of if statements something like <<< IF a some
cells are =0, subtract the count from the ranges in the formulas , But I
don't know how to state this in Excel terms.

Can someone give me a hand?

Thanks
Darrell

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 791
Default ... I need some help with a formula ...

excepting the need to exclude the zero values, is there any reason why the
=average() function isn'tbeing used here?

"Dr. Darrell" wrote:

Mike:

Thank you, this was nice and simple.

Darrell

"Dr. Darrell" wrote:

I have a column of data (A2:A53) which represent 2007 week ending dates,
(linked to cells of 52 worksheets).

I have a column of Data (B2:B53) which represents the hours worked for each
week, (also linked to cells of 52 worksheets). For weeks not worked yet, the
value is zero, (right now there are zeros in cells B13:B53).

I would like the average of the hours worked for the entire year, and I
would like the average of the hours worked between Cell B7 and B53.

If there were no zero's I could use the following formulas:

=(SUM(B2:B53))/(COUNT(A2:A53))
=(SUM(B7:B53))/(COUNT(A7:A53))

I think I should use a couple of if statements something like <<< IF a some
cells are =0, subtract the count from the ranges in the formulas , But I
don't know how to state this in Excel terms.

Can someone give me a hand?

Thanks
Darrell

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



All times are GMT +1. The time now is 06:10 PM.

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

About Us

"It's about Microsoft Excel"