ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional Formatting to Test Value in Cell (https://www.excelbanter.com/excel-worksheet-functions/76265-conditional-formatting-test-value-cell.html)

Carroll

Conditional Formatting to Test Value in Cell
 
Hello,

In cell A2, I have coded the formula "=NOW()". Sometimes I have to
hardcode a date from an earlier month in this cell. I wanted to use
conditional formatting to warn me with a color that the cell contains a
hardcoded date rather than "=NOW()", in case I forget to set the cell
back to "=NOW()". Does anyone know how I can use conditional
formatting to tell me either, that the cell has a hardcoded date, or,
that the formula "=NOW()" is not present in the cell. I've tried
different things and nothing has worked.

Thanks,

Carroll Rinehart


Carroll

Conditional Formatting to Test Value in Cell
 
I figured something out so no longer need help. I used "Formula IS"
=NOT(AND(MONTH(A2)=MONTH(NOW()),YEAR(A2)=YEAR(NOW( )),DAY(A2)=DAY(NOW()))).
The cell turns a color if not set to NOW(), or at least to a date
value equal to NOW().

Thanks anyway!

Carroll Rinehart


David McRitchie

Conditional Formatting to Test Value in Cell
 
Your formula has eliminated the time component in the
comparison, so that formulas will work. But for your normal
use you probably want to use =TODAY() instead of =NOW()

"Carroll" wrote in message oups.com...
I figured something out so no longer need help. I used "Formula IS"
=NOT(AND(MONTH(A2)=MONTH(NOW()),YEAR(A2)=YEAR(NOW( )),DAY(A2)=DAY(NOW()))).
The cell turns a color if not set to NOW(), or at least to a date
value equal to NOW().

Thanks anyway!

Carroll Rinehart




Carroll

Conditional Formatting to Test Value in Cell
 
Thanks!



All times are GMT +1. The time now is 04:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com