Color (CF) last adjacent cell if it contains random text

K0st4din

Well-known Member
Joined
Feb 8, 2012
Messages
501
Office Version
  1. 2016
  2. 2013
  3. 2011
  4. 2010
  5. 2007
Platform
  1. Windows
Hello, everyone,
I am asking for a little help, is it possible with Conditional formatting to make the last cell containing text be colored red or some other color. I found examples, but there they are given if I search for a specific word. For example, I'm looking for House and if the word is there it can be colored, but in my example, things are dynamic and I only need it if there is random text OR the last occupied adjacent cell in the example E12 and F12 be colored.
Thank you in advance.


fasfgfgfhghjhjhkjkjkpage
fjafasf fasjfa 54karlondonfafafaf1
fjafasf fasjfa 54karlondonghfgfjf2
fjafasf fasjfa 54karlondondfsd3
fjafasf fasjfa 54karlondonvvbxbxbx4
fjafasf fasjfa 54karlondonhgfjhj5
fjafasf fasjfa 54karlondonfxvvx6
fjafasf fasjfa 54karlondonnbfgd7
fjafasf fasjfa 54karlondonxbfgr8
fjafasf fasjfa 54karlondonghtyt9
fjafasf fasjfa 54karlondonfhtjyu10
fjafasf fasjfa 54karlondonsdfereretr11
012
013
014
015
016
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Does this CF do what you want?

23 11 27.xlsm
EF
1kjkjkpage
2fafafaf1
3ghfgfjf2
4dfsd3
5vvbxbxbx4
6hgfjhj5
7fxvvx6
8nbfgd7
9xbfgr8
10ghtyt9
11fhtjyu10
12sdfereretr11
1312
1413
1514
1615
1716
CF Last
Cells with Conditional Formatting
CellConditionCell FormatStop If True
F2:F17Expression=AND(E2<>"",COUNTA(E2:E$1000)=1)textNO
 
Upvote 0
Hello, it works, but I didn't foresee that in column E I have formulas that take the text from another worksheet and I think from there with your formula it colors me, but the last cell, apparently reads the formulas. I didn't foresee that, or I'm wrong somewhere.
2023-11-27_083138.jpg
2023-11-27_083226.jpg

It should color cell F3, but either I'm mistaken or because of the formulas it "reads" wrong
 
Upvote 0
in column E I have formulas
That's one reason 'Mini Sheet' is generally better to use than 'Table Only' with XL2BB. :)

Change the CF formula to
Excel Formula:
=AND(E2<>"",COUNTIF(E2:E$1000,"?*")=1)
 
Upvote 1
Solution
Thank you very much, now it is doing it right.
Thank you very much for the quick response.
Be alive and well.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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