Highlight row if cell contains text but not if date is entered (but generally formatted!)

SaraWitch

Active Member
Joined
Sep 29, 2015
Messages
377
Office Version
  1. 365
Platform
  1. Windows
Hello peeps,

I have a column where a date is entered. However, I cannot format the cells as a date as text also need to be added to the same cell (a further column is not wanted!). Is there a way I can highlight the whole row if the cell contains text but not a date? All the (CF) formulas I know work around the cells being formatted as a date, so not sure it can be done...

Any help would be greatly appreciated! :)
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
how will the date be entered into the cell - first , anywhere
as far as excel is concerned its just text and so need some rules to identify - i guess
like looking for some / /
if its random, can you provide examples of how the cell will look

5/4/24 text 123 bla bla
05/04/24 text 123 bla bla
5th April 2024 text 123 bla bla
text 123 05/04/24 bla bla
 
Upvote 0
Ah, so I can conditionally format saying if text doesn't contain slashes, then highlight row...?

I've just tried:
Excel Formula:
=$S3<>"*/*"
But that's highlighting all cells... :unsure:

And:
Excel Formula:
=COUNTIF($S2,"*/*")=0
But that's highlighting all cells (including those with dates, that are all formatted "dd/mm/yyyy"), except the "N/A" ones... :unsure:
 
Last edited:
Upvote 0
try

=AND(A2<>"",NOT(ISNUMBER(SEARCH("/",A2,1))))

columns D,E<F are not needed - just shows the evolution of formula

so change to your column S3 , if thats where it starts
=AND($S3<>"",NOT(ISNUMBER(SEARCH("/",$S3,1))))

Book5
ABCDE
1this will find /finds without / and also ignore blank cells
2123FALSETRUE
312aaa4FALSETRUE
4abcFALSETRUE
51/2/24 aaaaTRUEFALSE
6bbbFALSETRUE
701/02/2023 aaaTRUEFALSE
8FALSEFALSE
9FALSEFALSE
10FALSEFALSE
11FALSEFALSE
Sheet1
Cell Formulas
RangeFormula
D2:D11D2=ISNUMBER(SEARCH("/",A2,1))
E2:E11E2=AND(A2<>"",NOT(ISNUMBER(SEARCH("/",A2,1))))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A14Expression=AND(A2<>"",NOT(ISNUMBER(SEARCH("/",A2,1))))textNO
 
Upvote 0
Solution
Nearly! But it's also highlighting where there are only dates for me... :unsure:
¦ MrExcel Queries.xlsm
A
1Testing
202/04/2024
304/04/2024
4N/A
5Testing
605/04/2024 Testing
Highlight Row
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A10Expression=AND(A1<>"",NOT(ISNUMBER(SEARCH("/",A1,1))))textNO


And, just thought, I also need the row highlighted if the cell is blank (but there is text in column A):
¦ MrExcel Queries.xlsm
ABCDE
1CFDesired
2Address 1TestingAddress 1Testing
3Address 202/04/2024Address 202/04/2024
4Address 304/04/2024Address 304/04/2024
5Address 4N/AAddress 4N/A
6Address 5TestingAddress 5Testing
7Address 605/04/2024 TestingAddress 605/04/2024 Testing
8Address 7Testing 05/04/2024Address 7Testing 05/04/2024
9Address 8Address 8
10
Highlight Row
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:B12Expression=AND($B2<>"",NOT(ISNUMBER(SEARCH("/",$B2,1))))textNO
 
Last edited:
Upvote 0
yep, because it will NOT have a / thats a REAL date
which is a number
and excel puts a MASK over the number to show as a date when the cell is formatted as a date - or they just enter a date and excel will automatically format as a date

4/4/24 is 45386

so we could add an OR to exclude number above xxx

BUT will people just enter a number like
45386
and it means a number NOT a date

excel adds a 1 for every day

so next year would be something like 45386 + 365
45751
 
Upvote 0
Ah, brilliant - so I've formatted the cells as 'Text' and it works!!! Fantastic! Thank you so much, @etaf - wouldn't have got there on my own! 😁

(I tweaked the formula to also highlight blanks if text in first column.)
¦ MrExcel Queries.xlsm
ABCDE
1CFDesired
2Address 1TestingAddress 1Testing
3Address 202/04/2024Address 202/04/2024
4Address 304/04/2024Address 304/04/2024
5Address 4N/AAddress 4N/A
6Address 5TestingAddress 5Testing
7Address 605/04/2024 TestingAddress 605/04/2024 Testing
8Address 7Testing 05/04/2024Address 7Testing 05/04/2024
9Address 8Address 8
10
11
12
Highlight Row
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:B12Expression=AND($A2<>"",NOT(ISNUMBER(SEARCH("/",$B2,1))))textNO
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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