Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
RGB
 
Posts: n/a
Default Conditional formatting based on date range

Hi,

I am trying to create a formula which will;

Firstly check if a date is in a range:

* If not, then zero should be returned

*If yes - the formula should check again to see if the date matches a
specific date (only needs to match the month - not the exact day!)

(If the date does match- Then formula should then return a value from
another table.

If it doesn't match the exact date, (but is still part of the original
range) then a different $ value should be calculated based. This is based on
a total $ value divided by a number of specified months.

I need to work this out for many years information!

So far I have;

=IF(AND(F$1=data!$K2, F$1<=data!$H2),
(IF(G$1=data!K2),D2,(data!$I2/$C2),(""))

Which doesnt work - Anybody got any ideas?

Many Thanks



  #2   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Conditional formatting based on date range

Hi

Try this:
=IF(AND(F$1=data!$K2, F$1<=data!$H2), IF(G$1=data!K2,D2,data!$I2/$C2),"")

Andy.

"RGB" wrote in message
...
Hi,

I am trying to create a formula which will;

Firstly check if a date is in a range:

* If not, then zero should be returned

*If yes - the formula should check again to see if the date matches a
specific date (only needs to match the month - not the exact day!)

(If the date does match- Then formula should then return a value from
another table.

If it doesn't match the exact date, (but is still part of the original
range) then a different $ value should be calculated based. This is based
on
a total $ value divided by a number of specified months.

I need to work this out for many years information!

So far I have;

=IF(AND(F$1=data!$K2, F$1<=data!$H2),
(IF(G$1=data!K2),D2,(data!$I2/$C2),(""))

Which doesn't work - Anybody got any ideas?

Many Thanks





  #3   Report Post  
Posted to microsoft.public.excel.misc
Miguel Zapico
 
Posts: n/a
Default Conditional formatting based on date range

Could you post some example with numbers? The sintaxis of the formula is not
wrong at first sight, so what do you mean by "doesn't work"?
What puzzles me is why you are using both F1 and G1 in the comprobations,
maybe with data it will be more clear (if that is the month comprobation,
maybe changing G$1=data!K2 for MONTH(F$1)=MONTH(data!$K2) can help)

Miguel.

"RGB" wrote:

Hi,

I am trying to create a formula which will;

Firstly check if a date is in a range:

* If not, then zero should be returned

*If yes - the formula should check again to see if the date matches a
specific date (only needs to match the month - not the exact day!)

(If the date does match- Then formula should then return a value from
another table.

If it doesn't match the exact date, (but is still part of the original
range) then a different $ value should be calculated based. This is based on
a total $ value divided by a number of specified months.

I need to work this out for many years information!

So far I have;

=IF(AND(F$1=data!$K2, F$1<=data!$H2),
(IF(G$1=data!K2),D2,(data!$I2/$C2),(""))

Which doesnt work - Anybody got any ideas?

Many Thanks



  #4   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph
 
Posts: n/a
Default Conditional formatting based on date range

"RGB" wrote in message
...
Hi,

I am trying to create a formula which will;

Firstly check if a date is in a range:

* If not, then zero should be returned

*If yes - the formula should check again to see if the date matches a
specific date (only needs to match the month - not the exact day!)

(If the date does match- Then formula should then return a value from
another table.

If it doesn't match the exact date, (but is still part of the original
range) then a different $ value should be calculated based. This is based
on
a total $ value divided by a number of specified months.

I need to work this out for many years information!

So far I have;

=IF(AND(F$1=data!$K2, F$1<=data!$H2),
(IF(G$1=data!K2),D2,(data!$I2/$C2),(""))

Which doesn't work - Anybody got any ideas?


1 If the value you are trying to test is in F1, you've used that in one
place but you've used G1 in the next line. Or is G1 something you've
created to deal with only needing the same month?

2 You've used K2 as one limit for the range of dates, and you've also
used it as the reference against which to check for the specific date; was
that intentional?
[But again it isn't clear how you've dealt with the fact that you're only
looking for the same month. You may want to use the MONTH() function, but
perhaps you also want to check for it being the same YEAR()?]

3 The syntax of your second IF statement is illegal. Within the brackets
you need the condition, then a comma then the result if true, then another
comma and the result if false. You've closed the bracket after the
condition. You don't need the bracket before the second IF, and you've also
got additional sets of brackets which aren't necessary & which merely
confuse you when you're looking to see what's where, so perhaps that second
line should read:
IF(G$1=data!K2,D2,data!$I2/$C2),"")

4 You said the answer if it didn't fall within the first range should be
zero, but you've given "" to return an empty result.
--
David Biddulph


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
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
Sum based on date range Michael Excel Discussion (Misc queries) 8 March 27th 06 08:25 PM
Conditional cell background formatting, based on cell content nosivad Excel Discussion (Misc queries) 5 February 11th 06 11:12 PM
Conditional Formatting (Date vs Number) [email protected] Excel Discussion (Misc queries) 7 December 20th 04 10:23 PM
HOW TO USE CONDITIONAL FORMATTING FROM ONE RANGE TO ANOTHER RANGE PeggyP Excel Worksheet Functions 2 November 4th 04 07:29 PM


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