Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Sue
 
Posts: n/a
Default Filtering dates using a formula

Does anyone know a formula that will change a date to 1/04/05 when it is
prior to that date eg. 1/04/04:31/03/05. It must be able to let through the
dates that fall after 1/04/05 eg. 1/04/05:31/03/06.
I need the same thing again but where the formula only alters the dates that
are after 31/03/06 eg. 1/04/06:31/03/07 and defaults them to 31/03/06 and
leaves alone any dates that are prior to 31/03/06 eg. 1/04/05:31/03/06.
Have had one suggestion but it does do what I need.
The dates come from paste link cells in another workbook.
Can anyone please help?
Formula tried so far:
if(link<startdate,startdate,if(linkfinishdate,fin ishdate,link))
Sue
  #2   Report Post  
Sue
 
Posts: n/a
Default



"Sue" wrote:

Does anyone know a formula that will change a date to 1/04/05 when it is
prior to that date eg. 1/04/04:31/03/05. It must be able to let through the
dates that fall after 1/04/05 eg. 1/04/05:31/03/06.
I need the same thing again but where the formula only alters the dates that
are after 31/03/06 eg. 1/04/06:31/03/07 and defaults them to 31/03/06 and
leaves alone any dates that are prior to 31/03/06 eg. 1/04/05:31/03/06.
Have had one suggestion but it does NOT do what I need.
The dates come from paste link cells in another workbook.
Can anyone please help?
Formula tried so far:
if(link<startdate,startdate,if(linkfinishdate,fin ishdate,link))
Sue

  #3   Report Post  
bj
 
Posts: n/a
Default

try
=max(datevalue("1/04/05"),real date)
and =min(datevalue("31/03/06"),real date)

If you want to combine the two
=if(realdatedatevalue("31/03/06"),datevalue("31/03/06"),max(datevalue("1/04/05"),real date)

"Sue" wrote:

Does anyone know a formula that will change a date to 1/04/05 when it is
prior to that date eg. 1/04/04:31/03/05. It must be able to let through the
dates that fall after 1/04/05 eg. 1/04/05:31/03/06.
I need the same thing again but where the formula only alters the dates that
are after 31/03/06 eg. 1/04/06:31/03/07 and defaults them to 31/03/06 and
leaves alone any dates that are prior to 31/03/06 eg. 1/04/05:31/03/06.
Have had one suggestion but it does do what I need.
The dates come from paste link cells in another workbook.
Can anyone please help?
Formula tried so far:
if(link<startdate,startdate,if(linkfinishdate,fin ishdate,link))
Sue

  #4   Report Post  
Sue
 
Posts: n/a
Default

Hi bj,
I am still not getting it to work. What am I doing wrong?
example is:
For my start date column I need any dates prior to 1/04/05 to default to
1/04/05 and any start dates after 1/04/05 to stay as they are in that column.
My first cell in my start date column has the paste link formula =C2.
Based on your suggestion, how would I write it? I'm sorry I'm new to all
these formula's and even though have learnt a bit and tried different
formula's I'm not having much luck on this one.
Thanks Sue


"bj" wrote:

try
=max(datevalue("1/04/05"),real date)
and =min(datevalue("31/03/06"),real date)

If you want to combine the two
=if(realdatedatevalue("31/03/06"),datevalue("31/03/06"),max(datevalue("1/04/05"),real date)

"Sue" wrote:

Does anyone know a formula that will change a date to 1/04/05 when it is
prior to that date eg. 1/04/04:31/03/05. It must be able to let through the
dates that fall after 1/04/05 eg. 1/04/05:31/03/06.
I need the same thing again but where the formula only alters the dates that
are after 31/03/06 eg. 1/04/06:31/03/07 and defaults them to 31/03/06 and
leaves alone any dates that are prior to 31/03/06 eg. 1/04/05:31/03/06.
Have had one suggestion but it does do what I need.
The dates come from paste link cells in another workbook.
Can anyone please help?
Formula tried so far:
if(link<startdate,startdate,if(linkfinishdate,fin ishdate,link))
Sue

  #5   Report Post  
bj
 
Posts: n/a
Default

try
=if(c2datevalue("31/03/06"),datevalue("31/03/06"),max(datevalue("1/04/05"),C2)

on the chance that the input data is text that looks like dates rather than
actual dates you could also try

=if(datevalue(C2)datevalue("31/03/06"),datevalue("31/03/06"),max(datevalue("1/04/05"),datevalue(C2))
other things that might be happening. Depending on what version of Excel
you have, your dates may need to be in "mm/dd/yy" or "dd/mm/yy" format,
also in some versions of Excel, some of the commas in the formula may need to
be ";".

if you have mixed text and dates, you may have to convert all of the text
to dates.
If there are spaces associated with the text dates, you may need to use the
Trim() function before date value will work.
A simple way to check your input data is to select the column and
<format<cells<numberand play with different date formats and see if the
entire column changes. another simple way to check is to enter
=counta(C:C)-Count(C:C) in an unused Cell. If the value is greater than the
number of known labels in the column, you probably have some text which
looks like a date.

"Sue" wrote:

Hi bj,
I am still not getting it to work. What am I doing wrong?
example is:
For my start date column I need any dates prior to 1/04/05 to default to
1/04/05 and any start dates after 1/04/05 to stay as they are in that column.
My first cell in my start date column has the paste link formula =C2.
Based on your suggestion, how would I write it? I'm sorry I'm new to all
these formula's and even though have learnt a bit and tried different
formula's I'm not having much luck on this one.
Thanks Sue


"bj" wrote:

try
=max(datevalue("1/04/05"),real date)
and =min(datevalue("31/03/06"),real date)

If you want to combine the two
=if(realdatedatevalue("31/03/06"),datevalue("31/03/06"),max(datevalue("1/04/05"),real date)

"Sue" wrote:

Does anyone know a formula that will change a date to 1/04/05 when it is
prior to that date eg. 1/04/04:31/03/05. It must be able to let through the
dates that fall after 1/04/05 eg. 1/04/05:31/03/06.
I need the same thing again but where the formula only alters the dates that
are after 31/03/06 eg. 1/04/06:31/03/07 and defaults them to 31/03/06 and
leaves alone any dates that are prior to 31/03/06 eg. 1/04/05:31/03/06.
Have had one suggestion but it does do what I need.
The dates come from paste link cells in another workbook.
Can anyone please help?
Formula tried so far:
if(link<startdate,startdate,if(linkfinishdate,fin ishdate,link))
Sue



  #6   Report Post  
Sue
 
Posts: n/a
Default

Hi bj,
Thanks so much. I'm now up and running. Great!
Sue

"bj" wrote:

try
=if(c2datevalue("31/03/06"),datevalue("31/03/06"),max(datevalue("1/04/05"),C2)

on the chance that the input data is text that looks like dates rather than
actual dates you could also try

=if(datevalue(C2)datevalue("31/03/06"),datevalue("31/03/06"),max(datevalue("1/04/05"),datevalue(C2))
other things that might be happening. Depending on what version of Excel
you have, your dates may need to be in "mm/dd/yy" or "dd/mm/yy" format,
also in some versions of Excel, some of the commas in the formula may need to
be ";".

if you have mixed text and dates, you may have to convert all of the text
to dates.
If there are spaces associated with the text dates, you may need to use the
Trim() function before date value will work.
A simple way to check your input data is to select the column and
<format<cells<numberand play with different date formats and see if the
entire column changes. another simple way to check is to enter
=counta(C:C)-Count(C:C) in an unused Cell. If the value is greater than the
number of known labels in the column, you probably have some text which
looks like a date.

"Sue" wrote:

Hi bj,
I am still not getting it to work. What am I doing wrong?
example is:
For my start date column I need any dates prior to 1/04/05 to default to
1/04/05 and any start dates after 1/04/05 to stay as they are in that column.
My first cell in my start date column has the paste link formula =C2.
Based on your suggestion, how would I write it? I'm sorry I'm new to all
these formula's and even though have learnt a bit and tried different
formula's I'm not having much luck on this one.
Thanks Sue


"bj" wrote:

try
=max(datevalue("1/04/05"),real date)
and =min(datevalue("31/03/06"),real date)

If you want to combine the two
=if(realdatedatevalue("31/03/06"),datevalue("31/03/06"),max(datevalue("1/04/05"),real date)

"Sue" wrote:

Does anyone know a formula that will change a date to 1/04/05 when it is
prior to that date eg. 1/04/04:31/03/05. It must be able to let through the
dates that fall after 1/04/05 eg. 1/04/05:31/03/06.
I need the same thing again but where the formula only alters the dates that
are after 31/03/06 eg. 1/04/06:31/03/07 and defaults them to 31/03/06 and
leaves alone any dates that are prior to 31/03/06 eg. 1/04/05:31/03/06.
Have had one suggestion but it does do what I need.
The dates come from paste link cells in another workbook.
Can anyone please help?
Formula tried so far:
if(link<startdate,startdate,if(linkfinishdate,fin ishdate,link))
Sue

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
Formula for Continuous Services Dates pvbridges Excel Worksheet Functions 1 June 19th 05 01:51 AM
Formula including dates R L Sandel Excel Worksheet Functions 2 May 25th 05 12:30 PM
dates formula Jerry Kinder Excel Worksheet Functions 6 May 18th 05 08:34 PM
How do I format dates accessed by a formula Mont22 Excel Discussion (Misc queries) 2 January 12th 05 04:09 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM


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