#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DKS DKS is offline
external usenet poster
 
Posts: 103
Default Cross tab query

I have a worksheet with 2 columns.

First column contains a date (several duplicates possible, even in hundreds).

Second column contains a code (4 or 5 different values).

Duplicates possible for first column + second column combination. For
example, for a given date, many records possible with same code value.

How could I write a formula to give me per code value the "unique" number of
dates found between 2 given date values. Meaning, as parameter I can pass
three arguments viz.
code value
start date value
end date value

In return I want the number of unique dates (including start and end date)
to be returned.

All help appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Cross tab query

Criterias
In D1: holds code value
In D2: holds start date
In D3: holds end date

=SUM(N(FREQUENCY(IF((Code=D1)*(Date=D2)*(Date<=D3 ),Date),Date)0))

ctrl+shift+enter, not just enter


"DKS" wrote:

I have a worksheet with 2 columns.

First column contains a date (several duplicates possible, even in hundreds).

Second column contains a code (4 or 5 different values).

Duplicates possible for first column + second column combination. For
example, for a given date, many records possible with same code value.

How could I write a formula to give me per code value the "unique" number of
dates found between 2 given date values. Meaning, as parameter I can pass
three arguments viz.
code value
start date value
end date value

In return I want the number of unique dates (including start and end date)
to be returned.

All help appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DKS DKS is offline
external usenet poster
 
Posts: 103
Default Cross tab query

I did not understand the last 2 "Date" parameters. What does that refer to?
Should it refer to the column that contains all the dates?

"Teethless mama" wrote:

Criterias
In D1: holds code value
In D2: holds start date
In D3: holds end date

=SUM(N(FREQUENCY(IF((Code=D1)*(Date=D2)*(Date<=D3 ),Date),Date)0))

ctrl+shift+enter, not just enter


"DKS" wrote:

I have a worksheet with 2 columns.

First column contains a date (several duplicates possible, even in hundreds).

Second column contains a code (4 or 5 different values).

Duplicates possible for first column + second column combination. For
example, for a given date, many records possible with same code value.

How could I write a formula to give me per code value the "unique" number of
dates found between 2 given date values. Meaning, as parameter I can pass
three arguments viz.
code value
start date value
end date value

In return I want the number of unique dates (including start and end date)
to be returned.

All help appreciated.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DKS DKS is offline
external usenet poster
 
Posts: 103
Default Cross tab query

Yes, it is the column. I tried it out and it gives the correct results.
Thanks for your help.

"DKS" wrote:

I did not understand the last 2 "Date" parameters. What does that refer to?
Should it refer to the column that contains all the dates?

"Teethless mama" wrote:

Criterias
In D1: holds code value
In D2: holds start date
In D3: holds end date

=SUM(N(FREQUENCY(IF((Code=D1)*(Date=D2)*(Date<=D3 ),Date),Date)0))

ctrl+shift+enter, not just enter


"DKS" wrote:

I have a worksheet with 2 columns.

First column contains a date (several duplicates possible, even in hundreds).

Second column contains a code (4 or 5 different values).

Duplicates possible for first column + second column combination. For
example, for a given date, many records possible with same code value.

How could I write a formula to give me per code value the "unique" number of
dates found between 2 given date values. Meaning, as parameter I can pass
three arguments viz.
code value
start date value
end date value

In return I want the number of unique dates (including start and end date)
to be returned.

All help appreciated.

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
Duplicate Query with a twist.... (Cross Posted) Bryan Excel Discussion (Misc queries) 0 November 15th 06 11:26 AM
Importing Data via Web Query - Can values be passed to query? [email protected] Excel Discussion (Misc queries) 5 May 9th 06 06:21 PM
Save data retreived from query without saving query Anthony Excel Discussion (Misc queries) 0 January 25th 06 07:17 PM
Microsoft Query rejects "nz" function in Access Query Vaughan Excel Discussion (Misc queries) 0 May 4th 05 05:20 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM


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