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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
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,214,947
Messages
6,122,411
Members
449,081
Latest member
JAMES KECULAH

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