Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Ignoring non-filled formulas in average

Hi,

I'm trying to generate a list of timespans where I eventually want the
average. The timespans (column C) is calculated by formula (B-A). This list
will be constantly updated so I have prepared the formulas for the cells even
though the dates aren't filled in.

An illustration of my spread sheet is:

Row A B C
1 2009-01-01 2009-01-10 9
2 2009-01-01 2009-01-20 19
3 2009-01-05 2009-01-10 5
4 2009-01-15 2009-01-15 0
5 0 (b5-a5)
6 0 (b6-a6)
....


When I want the average so far it counts with the rows not yet filled in as
well (row 5-6 in the example). My question is; Can I ignore the rows not yet
filled in in any smart way? One option that I have tried is to ignore
everything less than 1 when doing the average formula but then I risk missing
the few ones where the timespan equals 0 (C4 in the example).


Thx for your support!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Ignoring non-filled formulas in average

You could have a formula like this in C1:

=IF(OR(A1="",B1=""),"",B1-A1)

and then copy this down. If either (or both) cell is blank it will
return a blank, and this will not be counted in your AVERAGE formula.

Hope this helps.

Pete

On Jan 26, 12:50*pm, Laurizio
wrote:
Hi,

I'm trying to generate a list of timespans where I eventually want the
average. The timespans (column C) is calculated by formula (B-A). This list
will be constantly updated so I have prepared the formulas for the cells even
though the dates aren't filled in.

An illustration of my spread sheet is:

Row * A * * * * * * * * * B * * * * * * * * * * *C
1 * * * *2009-01-01 * *2009-01-10 * * * *9
2 * * * *2009-01-01 * *2009-01-20 * * * *19
3 * * * *2009-01-05 * *2009-01-10 * * * *5
4 * * * *2009-01-15 * *2009-01-15 * * * *0
5 * * * * * * * * * * * * * * * * * * * * * * * * * * 0 (b5-a5)
6 * * * * * * * * * * * * * * * * * * * * * * * * * * 0 (b6-a6)
...

When I want the average so far it counts with the rows not yet filled in as
well (row 5-6 in the example). My question is; Can I ignore the rows not yet
filled in in any smart way? One option that I have tried is to ignore
everything less than 1 when doing the average formula but then I risk missing
the few ones where the timespan equals 0 (C4 in the example).

Thx for your support!


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Ignoring non-filled formulas in average

Thanks, that seems plausible.

However, if I type it in the same way it gives me a message saying "the
formula you typed contains an error...". After the message the marker
higlights "",b1 in the formula.

Any idea of what I'm doing wrong?!

Thanks again!




"Pete_UK" wrote:

You could have a formula like this in C1:

=IF(OR(A1="",B1=""),"",B1-A1)

and then copy this down. If either (or both) cell is blank it will
return a blank, and this will not be counted in your AVERAGE formula.

Hope this helps.

Pete

On Jan 26, 12:50 pm, Laurizio
wrote:
Hi,

I'm trying to generate a list of timespans where I eventually want the
average. The timespans (column C) is calculated by formula (B-A). This list
will be constantly updated so I have prepared the formulas for the cells even
though the dates aren't filled in.

An illustration of my spread sheet is:

Row A B C
1 2009-01-01 2009-01-10 9
2 2009-01-01 2009-01-20 19
3 2009-01-05 2009-01-10 5
4 2009-01-15 2009-01-15 0
5 0 (b5-a5)
6 0 (b6-a6)
...

When I want the average so far it counts with the rows not yet filled in as
well (row 5-6 in the example). My question is; Can I ignore the rows not yet
filled in in any smart way? One option that I have tried is to ignore
everything less than 1 when doing the average formula but then I risk missing
the few ones where the timespan equals 0 (C4 in the example).

Thx for your support!



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Ignoring non-filled formulas in average

If you use a semicolon rather than a comma as delimiter, due to your
regional settings, then you might need to change the formula to this:

=IF(OR(A1="";B1="");"";B1-A1)

Hope this helps.

Pete

On Jan 26, 1:13*pm, Laurizio
wrote:
Thanks, that seems plausible.

However, if I type it in the same way it gives me a message saying "the
formula you typed contains an error...". After the message the marker
higlights "",b1 in the formula.

Any idea of what I'm doing wrong?!

Thanks again!



"Pete_UK" wrote:
You could have a formula like this in C1:


=IF(OR(A1="",B1=""),"",B1-A1)


and then copy this down. If either (or both) cell is blank it will
return a blank, and this will not be counted in your AVERAGE formula.


Hope this helps.


Pete


On Jan 26, 12:50 pm, Laurizio
wrote:
Hi,


I'm trying to generate a list of timespans where I eventually want the
average. The timespans (column C) is calculated by formula (B-A). This list
will be constantly updated so I have prepared the formulas for the cells even
though the dates aren't filled in.


An illustration of my spread sheet is:


Row * A * * * * * * * * * B * * * * * * * * * * *C
1 * * * *2009-01-01 * *2009-01-10 * * * *9
2 * * * *2009-01-01 * *2009-01-20 * * * *19
3 * * * *2009-01-05 * *2009-01-10 * * * *5
4 * * * *2009-01-15 * *2009-01-15 * * * *0
5 * * * * * * * * * * * * * * * * * * * * * * * * * * 0 (b5-a5)
6 * * * * * * * * * * * * * * * * * * * * * * * * * * 0 (b6-a6)
...


When I want the average so far it counts with the rows not yet filled in as
well (row 5-6 in the example). My question is; Can I ignore the rows not yet
filled in in any smart way? One option that I have tried is to ignore
everything less than 1 when doing the average formula but then I risk missing
the few ones where the timespan equals 0 (C4 in the example).


Thx for your support!- Hide quoted text -


- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Ignoring non-filled formulas in average

Hi,

Why not average column C only if there are entries in columns A & B

=AVERAGE(IF(A1:A20<"",IF(B1:B20<"",C1:C20)))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike

"Laurizio" wrote:

Hi,

I'm trying to generate a list of timespans where I eventually want the
average. The timespans (column C) is calculated by formula (B-A). This list
will be constantly updated so I have prepared the formulas for the cells even
though the dates aren't filled in.

An illustration of my spread sheet is:

Row A B C
1 2009-01-01 2009-01-10 9
2 2009-01-01 2009-01-20 19
3 2009-01-05 2009-01-10 5
4 2009-01-15 2009-01-15 0
5 0 (b5-a5)
6 0 (b6-a6)
...


When I want the average so far it counts with the rows not yet filled in as
well (row 5-6 in the example). My question is; Can I ignore the rows not yet
filled in in any smart way? One option that I have tried is to ignore
everything less than 1 when doing the average formula but then I risk missing
the few ones where the timespan equals 0 (C4 in the example).


Thx for your support!



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Ignoring non-filled formulas in average

Yes, that was it!

Excellent - many thanks!





"Pete_UK" wrote:

If you use a semicolon rather than a comma as delimiter, due to your
regional settings, then you might need to change the formula to this:

=IF(OR(A1="";B1="");"";B1-A1)

Hope this helps.

Pete

On Jan 26, 1:13 pm, Laurizio
wrote:
Thanks, that seems plausible.

However, if I type it in the same way it gives me a message saying "the
formula you typed contains an error...". After the message the marker
higlights "",b1 in the formula.

Any idea of what I'm doing wrong?!

Thanks again!



"Pete_UK" wrote:
You could have a formula like this in C1:


=IF(OR(A1="",B1=""),"",B1-A1)


and then copy this down. If either (or both) cell is blank it will
return a blank, and this will not be counted in your AVERAGE formula.


Hope this helps.


Pete


On Jan 26, 12:50 pm, Laurizio
wrote:
Hi,


I'm trying to generate a list of timespans where I eventually want the
average. The timespans (column C) is calculated by formula (B-A). This list
will be constantly updated so I have prepared the formulas for the cells even
though the dates aren't filled in.


An illustration of my spread sheet is:


Row A B C
1 2009-01-01 2009-01-10 9
2 2009-01-01 2009-01-20 19
3 2009-01-05 2009-01-10 5
4 2009-01-15 2009-01-15 0
5 0 (b5-a5)
6 0 (b6-a6)
...


When I want the average so far it counts with the rows not yet filled in as
well (row 5-6 in the example). My question is; Can I ignore the rows not yet
filled in in any smart way? One option that I have tried is to ignore
everything less than 1 when doing the average formula but then I risk missing
the few ones where the timespan equals 0 (C4 in the example).


Thx for your support!- Hide quoted text -


- Show quoted text -



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Ignoring non-filled formulas in average

You're welcome - thanks for feeding back.

Pete

On Jan 26, 1:34*pm, Laurizio
wrote:
Yes, that was it!

Excellent - many thanks!


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
average of different cells ignoring zero values awais Excel Discussion (Misc queries) 1 June 14th 08 11:45 PM
Criteria average ignoring blanks flumpuk Excel Discussion (Misc queries) 5 October 17th 07 11:39 AM
Criteria average ignoring blanks flumpuk Excel Discussion (Misc queries) 1 October 17th 07 11:19 AM
Average ignoring Zeros Gary Excel Worksheet Functions 3 February 21st 07 02:20 AM
Formula to average ignoring negatives? Steve Excel Discussion (Misc queries) 16 January 1st 05 12:57 PM


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