CF not formatting all cells

Snolune

New Member
Joined
Jan 11, 2018
Messages
14
I'm using a CF to format cells based on two values and it only formats one cell. It's applied to all cells to be changed and is only filling H7.

Rule: =MATCH(H8,V4,0)

Format: Grey Fill


Applies to: =$H$7:$J$35


Not sure if I'm going about this the hard way or not, but matching Day in row 8 (Sun, Mon, etc) to manually inputted day in cell V4 to format background to grey for range of cells above/below Day on a form that's showing two full weeks.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi,

Assuming $H$7:$J$35 is checking corresponding cell in row 8, but V4 is constant, try:

=MATCH(H8,$V$4,0)

Also note that your H8 is within the range $H$7:$J$35, so not sure if that's correct.
 
Last edited:
Upvote 0
Thanks, but it's still only changing one cell. I even applied the CF to H9, I9, J9 and only H9 worked. Scratching my head on this one.
 
Upvote 0
Hi,

Had a second look at your formula, all it's doing is checking if H8=V4, is that right?
Because it can be just =H8=V4

If that's not the case, please explain how your data is laid out, and what you want.
 
Upvote 0
jtakw, that would be correct. The problem is that it isn't applying to all the cells that have been chosen.
 
Upvote 0
jtakw, that would be correct. The problem is that it isn't applying to all the cells that have been chosen.

The following cells are not being filled.
H8 (merged)
I10
I11
H19, I19, J19
H26, I26, J26
H31, I31, J31


Drop Down Menu: V4 [Monday, Tuesday, Wednesday, Thursday, Friday]

Cells formatted with Conditional Formatting
H7 through J35

CF Rule: =H8=V4
Fill H7:J35
 
Upvote 0
Should EVERY cell in your range (H7:J135) be looking at cells H8 and V4?
If so, they you need to lock them down, like this:
Code:
=$H$8=$V$4
So if you select your entire range, and then enter that formula, it should work.

Also, I would HIGHLY recommend getting rid of the merged cells. Merged cells cause nothing but trouble in Excel! They interfere with a whole myriad of things, like sorting, VBA, ....
If you are just merging cells across rows, you can get the same visual effect without all the issues by using the "Center Across Selection" formatting option instead.
See: https://www.atlaspm.com/toms-tutori...er-across-selection-instead-of-merging-cells/
 
Last edited:
Upvote 0
You are welcome!

Yes, when applying formulas over a range of cells, you want to use Absolute References ($) in front of the column/row references that you want to lock down.
If you leave them off, they will "float" as you move across/down the cells in your range.

See here for a write-up on absolute, relative, and mixed range references: http://www.excel-easy.com/functions/cell-references.html
 
Upvote 0

Forum statistics

Threads
1,215,004
Messages
6,122,656
Members
449,091
Latest member
peppernaut

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