Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default conditional sum query

Hi there,

I have a table of data as follows:
Verified Date Value
01-Nov-06 26-Oct-06 3
01-Nov-06 31-Oct-06 3
01-Nov-06 31-Oct-06 10
03-Nov-06 02-Nov-06 2

I now need to set a formula that will test a couple conditions and then
return the sum of the true values

The condition is as follows:

Date equals my query date
if Date is a Monday to Thursday & Verified minus Date is less than 2 days or
if Date is a Friday or Saturday & Verified minus Date is less than 4 days or
if Date is a Sunday & Verified minus Date is less than 3 days
then sum the values in Value

I was able to do this when I was counting the true values only by using an
array on Count and If functions however I am now having difficulties in
rewriting this to sum.

Any tips please?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default conditional sum query

=SUM(IF(A2:A20-B2:B20<INDEX({2,4,4,4,4,3,3},MATCH(WEEKDAY(B2:B20) ,{1,2,3,4,5
,6,7},0)),C2:C20))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"dmorris1" wrote in message
...
Hi there,

I have a table of data as follows:
Verified Date Value
01-Nov-06 26-Oct-06 3
01-Nov-06 31-Oct-06 3
01-Nov-06 31-Oct-06 10
03-Nov-06 02-Nov-06 2

I now need to set a formula that will test a couple conditions and then
return the sum of the true values

The condition is as follows:

Date equals my query date
if Date is a Monday to Thursday & Verified minus Date is less than 2 days

or
if Date is a Friday or Saturday & Verified minus Date is less than 4 days

or
if Date is a Sunday & Verified minus Date is less than 3 days
then sum the values in Value

I was able to do this when I was counting the true values only by using an
array on Count and If functions however I am now having difficulties in
rewriting this to sum.

Any tips please?




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
Conditional formatting query oktc Excel Worksheet Functions 2 March 23rd 06 09:30 AM
Conditional MS Query Dean Excel Worksheet Functions 1 January 10th 06 01:52 PM
AHHH! Again JAA149 Excel Discussion (Misc queries) 0 October 31st 05 11:36 AM
AHHHH-Get Data from Multiple Excel workbooks JAA149 Excel Discussion (Misc queries) 5 October 30th 05 05:19 PM
How to preserve conditional formatting on a web query table result Simon L Excel Discussion (Misc queries) 9 February 26th 05 01:19 AM


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