Can I change the background color depending on the cell content?

Arana

New Member
Joined
Dec 20, 2022
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I am making an index of a large number of files and folders. My objective is to be able to modify the background color of all those cells that correspond to a folder, that is, that the path does not end in the file name and its extension.

I have tried to use the conditional rules that Excel offers to achieve it but it is impossible for me.

All help is welcome.

This is a small example:

1671538953185.png
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Put this into the conditional formatting. It looks for a "." in the text after the last "/" in the path.

Excel Formula:
=NOT(ISNUMBER(SEARCH(".",DROP(TEXTSPLIT(A1,,"/"),ROWS(TEXTSPLIT(A1,,"/"))-1))))
 
Upvote 0
can you search for a .
or count
=COUNTIF(A1,"*.*")

But conditional formatting wont highlight text separately
you will need VBA for that
Book2
A
1/folde/path/fiule.ext
2/folde/path/
3/folde/path/fiule.ext
4/folde/path/
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A4Expression=COUNTIF(A1,"*.*")textYES
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,175
Members
452,615
Latest member
bogeys2birdies

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