Conditional Formatting works only after highlighting the table

sabrez

New Member
Joined
Oct 25, 2017
Messages
12
Hi,

I am working on a Price Calculator. I need to highlight rows in the below table based on the value of a particular cell $D$6

[TABLE="class: grid, width: 818"]
<tbody>[TR]
[TD]Pricing Tiers[/TD]
[TD]Multiplier[/TD]
[TD]Low unit price[/TD]
[TD]Mid unit price[/TD]
[TD]High unit price[/TD]
[TD]Mid price sale Total[/TD]
[/TR]
[TR]
[TD]Level 1 Pricing[/TD]
[TD]AMF Cost x 2.5 to 3 times[/TD]
[TD]$22.85[/TD]
[TD]$25.13[/TD]
[TD]$27.42[/TD]
[TD]$2,741.69[/TD]
[/TR]
[TR]
[TD]Level 2 Pricing[/TD]
[TD]AMF Cost x 3.5 to 4 times[/TD]
[TD]$31.99[/TD]
[TD]$34.27[/TD]
[TD]$36.56[/TD]
[TD]$3,655.58[/TD]
[/TR]
[TR]
[TD]Level 3 Pricing[/TD]
[TD]AMF Cost x 4.5 to 5 times[/TD]
[TD]$41.13[/TD]
[TD]$43.41[/TD]
[TD]$45.69[/TD]
[TD]$4,569.48[/TD]
[/TR]
[TR]
[TD]Level 4 Pricing[/TD]
[TD]AMF Cost x 5.5 to 6 times[/TD]
[TD]$50.26[/TD]
[TD]$52.55[/TD]
[TD]$54.83[/TD]
[TD]$5,483.38[/TD]
[/TR]
[TR]
[TD]Level 5 Pricing[/TD]
[TD]AMF Cost x 6.5 to 7 times[/TD]
[TD]$59.40[/TD]
[TD]$61.69[/TD]
[TD]$63.97[/TD]
[TD]$6,397.27[/TD]
[/TR]
[TR]
[TD]Level 6 Pricing[/TD]
[TD]AMF Cost x 7.5 to 8 times[/TD]
[TD]$68.54[/TD]
[TD]$70.83[/TD]
[TD]$73.11[/TD]
[TD]$7,311.17[/TD]
[/TR]
[TR]
[TD]Level 7 Pricing[/TD]
[TD]AMF Cost x 8.5 to 9 times[/TD]
[TD]$77.68[/TD]
[TD]$79.97[/TD]
[TD]$82.25[/TD]
[TD]$8,225.06[/TD]
[/TR]
</tbody>[/TABLE]

If $D$6=1, row 1 should be highlighted, if $D$6=2, row 2 to be highlighted and so on.

Any help would be highly appreciated.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try this;

Highlight the whole area you want included in the conditional formatting,
Click: " Conditional Formatting "
Click: " New Rule "
Click: " Use a formula to determine which cells to format "

In the rule description bar enter this formula;
=IF(ROW(A9)=$D$6,TRUE,FALSE)

In the formula, replace " A9 " with the cell reference to the top left corner cell reference that you highlighted.

Click: " Format "

Then choose your color and or pattern, border, font, or numbering format that you would like.

Click " Ok ", and " Ok "

That should get you there...
 
Upvote 0
Hi Chris

Thanks for your reply.

Well, the formula works only AFTER I select the table in question.

To make myself clear, I input a value, say 2, in cell $D$6 and press enter- nothing happens. And then, when I select the table A1:F8, the second row (A3:F3) gets highlighted.

Any idea how to get around this?

Regards
Sabrez
 
Upvote 0
Sabrez

Why would you put a value in D6? Isn't that in the middle of the table in A1:F8?
 
Upvote 0
Sorry, my bad.

I would put a value in a cell NOT in table A1:F8, say D12, and based on the value of D12, respective row in table should be highlighted. Row 1 if D12=1, row 2 if D12=2, and so on


 
Upvote 0
This might be a stupid question but do you have Automatic Calculation turned off?

PS Is the header row to be counted as a row or is row 1 actually the first row of data?
 
Last edited:
Upvote 0
Hi Norie

Calculation Options is set to Automatic- all other formulas in the worksheet working fine.

Please discard header row, row 1 is the actual first row of data (A1= Level 1 Pricing)
 
Upvote 0
Hi Norie

Can you please check this https://app.box.com/file/267377438734? You can ignore the warning about Updating external links, if you get any.

The first sheet, Current Client Quote, has the table (A12:G19) where rows are to be highlighted, depending on the value of cell D6.

For me, this is only working after selecting the entire table. However, the formula works perfectly fine on another worksheet (Sheet2- last tab)

Any idea why is this happening?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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