Conditional formating specific number of cells based on another cell value

RedOctoberKnight

Board Regular
Joined
Nov 16, 2015
Messages
150
Office Version
  1. 2016
Platform
  1. Windows
Good Morning,

If possible, I'm trying to conditional format a specific number of cells based on another cell value.

For example, If I have 10 in A1, I want row 1 to conditional format the next cells in the row up to the value in A1. ( so if the value in A1 is 10, I want it to highlight the next 10 cells in the row. If it was 5, highlight the next 5 cells in the row and so on)

Hope this makes sense.

As always, your help is always very much appreciated!
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
select cell B1 and go to Conditional Formatting. Go to new rule> use a formula
and put this formula.

=COLUMN()<$A1+2

Then copy B1 and paste the format to other cells where you want the same formatting

ABCDEFGHIJ
15abcabcabcabcabcabcabcabcabc
27abcabcabcabcabcabcabcabcabc
38abcabcabcabcabcabcabcabcabc
43abcabcabcabcabcabcabcabcabc

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:
Upvote 0
Perfect! Thank you so much!
Whilst the suggestion does exactly what you asked, I would be a little wary of relying on it. After applying that CF, suppose that you decide to insert a new column (or columns) at the left of the sheet, or even between column A and column B, say to add some additional information. Immediately on doing that, an incorrect number of columns will be highlighted (try it).

For the layout described, I would suggest the much more robust CF formula of =COLUMNS($B1:B1)<=$A1
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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