If a cell contains a date

DarkoDeign2

Board Regular
Joined
Jun 20, 2023
Messages
76
Office Version
  1. 365
Platform
  1. Windows
Hi,

I need help with a formula for conditional formatting.

If cell A3 contains a date, then I would like to have cell AG2 formated (highlighted)
If cell A4 contains a date then I would like to have cell AG3 formated (highlighted)

Would appreciate your help with solving this for me.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Dates are really just numbers in Excel, with special date formatting (specifically, the number of days since 1/0/1900).

So we can just check for a number/value greater than zero.
Do the following:
1. Select cells AG2 and AG3
2. Go to Conditional Formatting
3. Select "New Rule"
4. Select "User a formula to determine which cells to format"
5. Enter the following formula:
Excel Formula:
=AND(ISNUMBER(A3),A3>0)
6. Click the Format button
7. Go to the Fill tab
8. Choose your desired color
9. Click OK twice
 
Upvote 0
Hi again,

I tried the your suggestion but I got an error message in Excel.
I forgot to mention that I will have data in cells A2:A1500. These cells are have the cell formatting "Date", don't know if this is causing any issues in this case?


S 2023-07-12.png
S 2023-07-12.png
 
Upvote 0
You may have different regional settings as me.
Does your Excel use commas or semi-colons to separate arguments in your functions?

Try replacing the commas with semi-colons, i.e.
Excel Formula:
=AND(ISNUMBER(A3);A3>0)

To change the range, just select the entire range you want to apply this to in step 1 of my instructions above.
 
Upvote 1
Solution
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,215,326
Messages
6,124,267
Members
449,149
Latest member
mwdbActuary

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top