#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Minus Dates

I have dates in Range("A2:A20") like see below
01/04/2009
05/04/2009
06/04/2009
10/04/2009
11/05/2009
etc………
And again I got date in cell B2 and in cell C2 and I want formula in
cell D2 which should return the number of days between the dates which
I have in cell B2 and C2 excluding the days for which I have dates in
Range("A2:A20"). For example at the moment I got date "31/03/2009" in
cell B2 and date "10/04/2009" in cell C2 and I got formula "=C2-B2" in
cell D2 which return the result 10 days. But I want formula somthing
like "=C2-B2-any date in range("A2:A20") equal to or more than B2- any
date in range("A2:A20") equal to or less than C2", in other words i
want to exclud the days for which i have dates in Range("A2:A20") from
the formula which i have in D2. I hope i was able to explain my
question. Please can any friend have any suggestion or solution for
what i should be doing.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Minus Dates

Did yo look at the workday function? Workday function will exclude datys
(holidays) and it excludes weekends. If you want weekends then you can add
the weekend back in with another function.

"K" wrote:

I have dates in Range("A2:A20") like see below
01/04/2009
05/04/2009
06/04/2009
10/04/2009
11/05/2009
etc€¦€¦€¦
And again I got date in cell B2 and in cell C2 and I want formula in
cell D2 which should return the number of days between the dates which
I have in cell B2 and C2 excluding the days for which I have dates in
Range("A2:A20"). For example at the moment I got date "31/03/2009" in
cell B2 and date "10/04/2009" in cell C2 and I got formula "=C2-B2" in
cell D2 which return the result 10 days. But I want formula somthing
like "=C2-B2-any date in range("A2:A20") equal to or more than B2- any
date in range("A2:A20") equal to or less than C2", in other words i
want to exclud the days for which i have dates in Range("A2:A20") from
the formula which i have in D2. I hope i was able to explain my
question. Please can any friend have any suggestion or solution for
what i should be doing.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Minus Dates

try

1.
=C2-B2-SUMPRODUCT(($A$2:$A$20B2)*($A$2:$A$20<C2))
insert it with ENTER

or


2.
=C2-B2-SUM(IF(($A$2:$A$20B2)*($A$2:$A$20<C2),1,))
CTRL+SHIFT+ENTER this formula as it is an array-formula
if you insert it correctly curly brackets {} will appear and the
formula will look like this

{=C2-B2-SUM(IF(($A$2:$A$20B2)*($A$2:$A$20<C2);1;))}



On 23 Mar, 11:09, K wrote:
I have dates in Range("A2:A20") like see below
01/04/2009
05/04/2009
06/04/2009
10/04/2009
11/05/2009
etc………
And again I got date in cell B2 and in cell C2 and I want formula in
cell D2 which should return the number of days between the dates which
I have in cell B2 and C2 excluding the days for which I have dates *in
Range("A2:A20"). *For example at the moment I got date "31/03/2009" in
cell B2 and date "10/04/2009" in cell C2 and I got formula "=C2-B2" in
cell D2 which return the result 10 days. *But I want formula somthing
like "=C2-B2-any date in range("A2:A20") equal to or more than B2- any
date in range("A2:A20") equal to or less than C2", in other words i
want to exclud the days for which i have dates in Range("A2:A20") from
the formula which i have in *D2. *I hope i was able to explain my
question. *Please can any friend have any suggestion or solution for
what i should be doing.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default Minus Dates

On Mar 23, 10:35*am, Jarek Kujawa wrote:
try

1.
=C2-B2-SUMPRODUCT(($A$2:$A$20B2)*($A$2:$A$20<C2))
insert it with ENTER

or

2.
=C2-B2-SUM(IF(($A$2:$A$20B2)*($A$2:$A$20<C2),1,))
CTRL+SHIFT+ENTER this formula as it is an array-formula
if you insert it correctly curly brackets {} will appear and the
formula will look like this

{=C2-B2-SUM(IF(($A$2:$A$20B2)*($A$2:$A$20<C2);1;))}

On 23 Mar, 11:09, K wrote:



I have dates in Range("A2:A20") like see below
01/04/2009
05/04/2009
06/04/2009
10/04/2009
11/05/2009
etc………
And again I got date in cell B2 and in cell C2 and I want formula in
cell D2 which should return the number of days between the dates which
I have in cell B2 and C2 excluding the days for which I have dates *in
Range("A2:A20"). *For example at the moment I got date "31/03/2009" in
cell B2 and date "10/04/2009" in cell C2 and I got formula "=C2-B2" in
cell D2 which return the result 10 days. *But I want formula somthing
like "=C2-B2-any date in range("A2:A20") equal to or more than B2- any
date in range("A2:A20") equal to or less than C2", in other words i
want to exclud the days for which i have dates in Range("A2:A20") from
the formula which i have in *D2. *I hope i was able to explain my
question. *Please can any friend have any suggestion or solution for
what i should be doing.- Hide quoted text -


- Show quoted text -


Thats brilliant. Thanks Jarek
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 896
Default Minus Dates

welcome
pls click YES if it helped you

On 23 Mar, 12:24, K wrote:
On Mar 23, 10:35 am, Jarek Kujawa wrote:





try


1.
=C2-B2-SUMPRODUCT(($A$2:$A$20B2)*($A$2:$A$20<C2))
insert it with ENTER


or


2.
=C2-B2-SUM(IF(($A$2:$A$20B2)*($A$2:$A$20<C2),1,))
CTRL+SHIFT+ENTER this formula as it is an array-formula
if you insert it correctly curly brackets {} will appear and the
formula will look like this


{=C2-B2-SUM(IF(($A$2:$A$20B2)*($A$2:$A$20<C2);1;))}


On 23 Mar, 11:09, K wrote:


I have dates in Range("A2:A20") like see below
01/04/2009
05/04/2009
06/04/2009
10/04/2009
11/05/2009
etc.........
And again I got date in cell B2 and in cell C2 and I want formula in
cell D2 which should return the number of days between the dates which
I have in cell B2 and C2 excluding the days for which I have dates in
Range("A2:A20"). For example at the moment I got date "31/03/2009" in
cell B2 and date "10/04/2009" in cell C2 and I got formula "=C2-B2" in
cell D2 which return the result 10 days. But I want formula somthing
like "=C2-B2-any date in range("A2:A20") equal to or more than B2- any
date in range("A2:A20") equal to or less than C2", in other words i
want to exclud the days for which i have dates in Range("A2:A20") from
the formula which i have in D2. I hope i was able to explain my
question. Please can any friend have any suggestion or solution for
what i should be doing.- Hide quoted text -


- Show quoted text -


Thats brilliant. Thanks Jarek- Ukryj cytowany tekst -

- Poka¿ cytowany tekst -




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default Minus Dates

Joel,
I was interested in your comment re 'adding the weekends back in with
another function' as this sounds exactly what I am looking for.
Using the WORKDAY function I can ignore holidays but I need to add back in
the weekends which need (in my case) to be included in the calc.
Thanks,
--
Traa Dy Liooar

Jock


"joel" wrote:

Did yo look at the workday function? Workday function will exclude datys
(holidays) and it excludes weekends. If you want weekends then you can add
the weekend back in with another function.

"K" wrote:

I have dates in Range("A2:A20") like see below
01/04/2009
05/04/2009
06/04/2009
10/04/2009
11/05/2009
etc€¦€¦€¦
And again I got date in cell B2 and in cell C2 and I want formula in
cell D2 which should return the number of days between the dates which
I have in cell B2 and C2 excluding the days for which I have dates in
Range("A2:A20"). For example at the moment I got date "31/03/2009" in
cell B2 and date "10/04/2009" in cell C2 and I got formula "=C2-B2" in
cell D2 which return the result 10 days. But I want formula somthing
like "=C2-B2-any date in range("A2:A20") equal to or more than B2- any
date in range("A2:A20") equal to or less than C2", in other words i
want to exclud the days for which i have dates in Range("A2:A20") from
the formula which i have in D2. I hope i was able to explain my
question. Please can any friend have any suggestion or solution for
what i should be doing.

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
Minus Dates K[_2_] Excel Discussion (Misc queries) 1 March 23rd 09 10:32 AM
Formula for dates minus the weekends TJH Excel Worksheet Functions 1 April 30th 07 04:50 PM
CHANGE TRAILING MINUS TO BRACKETS OR PRECEEDING MINUS Socal Analyst looking for help Excel Discussion (Misc queries) 2 May 12th 06 07:17 PM
Calculate Number of Days Between Dates Minus Weekends Melissa Excel Discussion (Misc queries) 3 March 6th 06 07:20 PM
Chronolize dates with varying days minus weekends Sheila Excel Worksheet Functions 1 February 10th 06 06:40 PM


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