conditional formating

mazharacca

New Member
Joined
Jun 22, 2017
Messages
9
My data contained in column A, I want to apply conditional formatting on the condition that if a cell contains word "LTD" OR "PVT" then format up to 5 non blank cells below the cells which meet the above mentioned criteria.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
I'm not quite clear about your question. Do you need something like below picture?
A23 should also be highlighted because it is the 5th non blank cell under A17
1591184889517.png
 
Upvote 0
for your reference:
Define a name Test1=COUNTIF(INDIRECT("A"&LOOKUP(1,0/MMULT(IFERROR(FIND({"LTD","PVT"},$A$1:$A1),),{1;1}),ROW($1:1))&":A"&ROW()),"*")<7
MrExcel.xlsx
AB
1CLTDcontain LTD
2D
3E
4F
5G
6H
7J
8PVTcontain PVT
9Q
10R
11w
12
13S
14
15T
16U
17V
18CLTDcontain LTD
19D
20
21Z
22AA
23DD
24PVTcontain PVT
25RR
Sheet4
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A1:A25Expression=Test1textNO
 
Upvote 0
When define the name, just paste =COUNTIF(INDIRECT("A"&LOOKUP(1,0/MMULT(IFERROR(FIND({"LTD","PVT"},$A$1:$A1),),{1;1}),ROW($1:1))&":A"&ROW()),"*")<7
In the "refer to" textbox.
 
Upvote 0

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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