Editor's Blog14 mins ago
Excel 2007 conditional format query
I am trying to format a cell based on the date in another cell. I can do this with other text and numbers in cells but cannot get it to work with a date.
Basically I would like the cell to change colour (which I know how to do) based on the date that is entered in the target cell.
Any advice ?
Basically I would like the cell to change colour (which I know how to do) based on the date that is entered in the target cell.
Any advice ?
Answers
well, here's a clunky way to get it done - convert dates to their excel dates - e.g. today (12/8/2011) is day 40855 (if you "clear formats" from a cell containing today's date, that's the number that will remain), It's then easy to conditionall y format cell b1 if cell a1 contains 40855 or any other Excel date.
23:11 Thu 08th Dec 2011
This describes how to format one cell based on the value in another cell:
http://www.exceldiges...alue-of-another-cell/
I assume you can do this? So in the "formula" box type something like:
=a1<"9/8/2011".
This will format the cell you're in when a1 contains a date prior to 9/8/2011.
http://www.exceldiges...alue-of-another-cell/
I assume you can do this? So in the "formula" box type something like:
=a1<"9/8/2011".
This will format the cell you're in when a1 contains a date prior to 9/8/2011.
well, here's a clunky way to get it done - convert dates to their excel dates - e.g. today (12/8/2011) is day 40855 (if you "clear formats" from a cell containing today's date, that's the number that will remain), It's then easy to conditionally format cell b1 if cell a1 contains 40855 or any other Excel date.
None of the conditional statements in Excel (any version) work on dates unless they are converted to serial numbers (where 1st Jan 1900 = 1). Maidup has identified the cause of the problem in that Excel uses the “/” delimiter in the date as an instruction to divide. So 14/12/11, for example, is calculated as 0.10606. That is why the conditional statements appear to work for “less than” conditions, but do not work for “equals” or “greater than”.
Others have got this worked out, but to clarify how to do it...
enter the date you want to use in a cell and press enter, goto format cell for that cell and change the format from date to general and the date you've just entered will turn to a number (from your example, 15/12/2011 will turn into 40892), make a note of this number and then you can change the format of the cell back to date.
then goto the cell you want to perform the conditional formatting on and use the formula =$A$1=40892 (assuming the date is in A1) and set the formatting to be what you want, click OK a few times and it should work.
enter the date you want to use in a cell and press enter, goto format cell for that cell and change the format from date to general and the date you've just entered will turn to a number (from your example, 15/12/2011 will turn into 40892), make a note of this number and then you can change the format of the cell back to date.
then goto the cell you want to perform the conditional formatting on and use the formula =$A$1=40892 (assuming the date is in A1) and set the formatting to be what you want, click OK a few times and it should work.
Related Questions
Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.