![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Feb 2002
Location: Benjamin
Posts: 8
|
My sheet has 4 rows of data and a total row that is supposed to average the results over a week. example:
week1 100 week2 125 week3 140 week4 98 Total =Average(A1:a4) Problem is if week 2,3 and 4 are empty or my user unknowingly enters a zero the average is incorrect. What I actually want to do is say if week1 is not empty or greater than 0 the average = week1. If week1 and week2 are not empty or greater than 0 then average week1 and week2. Is this possible? |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 202
|
|
|
|
|
|
|
#3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Board Regular
Join Date: Sep 2002
Location: Simsbury CT USA
Posts: 1,517
|
Try this
******** ******************** ************************************************************************>
[HtmlMaker 2.20] To see the formula in the cells just click on the cells hyperlink or click the Name box PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR. You need to entry this formular using Control/Shift/Enter keys pll [ This Message was edited by: plettieri on 2002-10-18 13:59 ] |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
#4 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, CO
Posts: 1,744
|
Another formula option would be
=SUM(A1:A4)/MAX(1,COUNTIF(A1:A4,">0")) which should work about the same as the array =AVERAGE(IF(A1:A4,A1:A4)) with your data, except no error message if no entries are made in A1:a4 |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|