Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Finding the average using conditions in a logic function - problem

Hi

I'm working on an excel sheet where I have 9 columns with dates (not all
populated) and i need to find the average of those dates depending a on
weather the "IF" function returns back a true or false answer.

eg - using only 6 dates **-***-** = not populated

Dates
1 2 3 4
5 6
01-aug-08 10-aug-08 09-aug-08 15-aug-08 **-***-** 20-aug-08
05-aug-08 20-aug-08 19-aug-08 **-***-** **-***-** 25-aug-08
10-sep-08 09-sep-08 20-sep-08 21-sep-08 23-sep-08 27-sep-08

ok, column 1 and 2 should always be populated but because different people
will use this file it is possible that they may forget to add dates in these
two columns. The question is I need an IF function to check the following
criteria:-

1. is column 1 populated - if false then neglect it
2. is column 2 populated - if false then neglect it
3. is column 2less than or equal to column 1 - if false then neglect it

from this i should get an array of just the rows just populated these
conditions. Then i need to find the sum of the difference of these dates left
after the conditions have been applied i.e from above will be
9+15+0=24 days (were row 3 give 0 as column 2 < column 1). When I try to do
it the sum function wont turn into an array and thus does not give the right
value when one of the columns is not populated so not sure how the
formulation should go.

Is this possible to do and if so is there a way to do this all in one step
using a formula?

Regards

Thomas
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,441
Default Finding the average using conditions in a logic function - problem

Thomas,

=SUMPRODUCT((A2:A100<"")*(B2:B100<"")*(B2:B100A 2:A100)*(B2:B100-A2:A100))

This will workb with dates or blanks in rows 2 to 100 of columns A and B.

HTH,
Bernie
MS Excel MVP


"Thomas" wrote in message
...
Hi

I'm working on an excel sheet where I have 9 columns with dates (not all
populated) and i need to find the average of those dates depending a on
weather the "IF" function returns back a true or false answer.

eg - using only 6 dates **-***-** = not populated

Dates
1 2 3 4
5 6
01-aug-08 10-aug-08 09-aug-08 15-aug-08 **-***-** 20-aug-08
05-aug-08 20-aug-08 19-aug-08 **-***-** **-***-** 25-aug-08
10-sep-08 09-sep-08 20-sep-08 21-sep-08 23-sep-08 27-sep-08

ok, column 1 and 2 should always be populated but because different people
will use this file it is possible that they may forget to add dates in these
two columns. The question is I need an IF function to check the following
criteria:-

1. is column 1 populated - if false then neglect it
2. is column 2 populated - if false then neglect it
3. is column 2less than or equal to column 1 - if false then neglect it

from this i should get an array of just the rows just populated these
conditions. Then i need to find the sum of the difference of these dates left
after the conditions have been applied i.e from above will be
9+15+0=24 days (were row 3 give 0 as column 2 < column 1). When I try to do
it the sum function wont turn into an array and thus does not give the right
value when one of the columns is not populated so not sure how the
formulation should go.

Is this possible to do and if so is there a way to do this all in one step
using a formula?

Regards

Thomas



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 with conditions mr_concrete Excel Worksheet Functions 3 February 7th 07 08:23 PM
Average of logic cells ckdkvk Excel Discussion (Misc queries) 2 December 1st 05 01:16 PM
Logic Problem JOn Kunces via OfficeKB.com Excel Discussion (Misc queries) 4 July 14th 05 04:32 PM
AVERAGE and STDEV functions with logic t-rung Excel Worksheet Functions 1 May 26th 05 07:11 PM
average on 2 conditions Ted Metro Excel Worksheet Functions 6 January 7th 05 08:23 PM


All times are GMT +1. The time now is 09:52 AM.

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"