Conditional Formatting - based on a given cell reference and a given range of cells from that cell reference

tstout1000

New Member
Joined
Jan 26, 2022
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I have an array (example below). I want to be able to highlight via conditional formatting using a Cell Reference (below N3) and range (below 5).
1643226674618.png


I have inputs that I can change the Cell Reference and Range, Example: Cell Reference = Q3 and Range = 9.
1643226866414.png


I can easily highlight the ending cell using format using a formula =CELL("address",B2)=$D$4 with $D$4 being the location of my input (e.g. Q3).
But I also want to highlight the preceding values dynamically (e.g. above the 8 previous columns).
Any help greatly appreciated.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
A long winded formula, but should get you what you want

Rename First worksheet Folder.xlsx
ABCDEFGHIJKLMNOPQRSTU
11234567891011121314151617AddressCellCount
2a19118618022310812179725213097188212074985127$N$36
3b19417923035381313421901271510910712188397
4c2437219210120235795818745722815610756159163
5d243959110850214611332481071151071785616910185
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B2:R8Expression=AND(ROW(B2)=ROW(INDIRECT($T$2)),COLUMN(INDIRECT($T$2))-COLUMN(B2)>=0,COLUMN(INDIRECT($T$2))-COLUMN(B2)<$U$2)textNO
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,718
Members
448,986
Latest member
andreguerra

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