![]() |
![]() |
|
|||||||
| 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: Jan 2002
Location: Canada
Posts: 42
|
I want to find the Average of cells F45 to Y45. But the last 5 cells (U45:Y45) do not have values in them yet. What do I need in the formula to ignore any cells that do not have a value, until they have a value. (number) in them?
|
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Hi
As far as I know, the Average function ignores blanks... Tom |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: Newcastle, UK
Posts: 1,174
|
Quote:
I personally prefer to omit any error in this area by using something like =SUM(F45:Y45)/COUNTIF(F45:Y45,">"&0). then I have a clear understanding of the formula rather than just exepting something working because that's what its ment to do.
__________________
"Have a good time......all the time" Ian Mac |
|
|
|
|
|
|
#4 | ||
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
That formula excludes true zeroes and negative numbers! Aladin |
||
|
|
|
|
|
#5 |
|
New Member
Join Date: Jan 2002
Location: Canada
Posts: 42
|
Yes that was the problem Ian. Those are formula generated blanks. (I guess)In this case, I don't have to worry about negative numbers nor should it ever be zero. There is either a number above zero, or nothing because the formula in that cell says not to put anything in there if no number has been put in the cell that connects to the formula. Sorry I don't know the exact terminology but I'm sure you can all use a good chuckle today.
Can I ask what the & sign does? |
|
|
|
|
|
#6 | |
|
MrExcel MVP
Join Date: Feb 2002
Location: The Hague
Posts: 50,317
|
Quote:
Start a clean worksheet. In A1 enter: =IF(B1,1,"") In A2 enter: 4 In A3 enter: 3 In A4 enter: =AVERAGE(A1:A3) =AVERAGE(A1,A2:A3) What do you get? BTW, & is a concatenation operator; In the formula Ian suggested, it creates ">0" when evaluated. & is needed to build up the condition argument in COUNTIF and SUMIF using cell references. Aladin |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|