Conditional formatting color based on the result of a cell containing a formula

silver37

New Member
Joined
Jul 4, 2016
Messages
3
I need to conditionally format a cell based on the value of another cell which contains a formula.

I have columns headed as follows:

Goods Pack Size Shop 1 price/100g Shop 2 price/100g Shop 3 price/100g Cheapest price
apples 1kg 2.50 =2.5/10 4.20 =4.20/10 6.30 =6.30/10 MIN(D2,F2,H2)


Using conditional formatting, I want to be able to highlight the "Cheapest price" cell based on the cheapest price per 100g of the three shops:
Shop 1 = blue
Shop2 = green
Shop 3 = red

However, when I use the VALUE option (i.e. the value of the cheapest price column is equal to the value in Shop 1 price/100g) it doesn't fill the cell as the value of that cell is a formula not a number.

This is obviously a very simple version of a much larger sheet so I can't really add columns or paste values instead of formulas.

Any ideas?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I need to conditionally format a cell based on the value of another cell which contains a formula.

I have columns headed as follows:

Goods Pack Size Shop 1 price/100g Shop 2 price/100g Shop 3 price/100g Cheapest price
apples 1kg 2.50 =2.5/10 4.20 =4.20/10 6.30 =6.30/10 MIN(D2,F2,H2)


Using conditional formatting, I want to be able to highlight the "Cheapest price" cell based on the cheapest price per 100g of the three shops:
Shop 1 = blue
Shop2 = green
Shop 3 = red


However, when I use the VALUE option (i.e. the value of the cheapest price column is equal to the value in Shop 1 price/100g) it doesn't fill the cell as the value of that cell is a formula not a number.

This is obviously a very simple version of a much larger sheet so I can't really add columns or paste values instead of formulas.

Any ideas?

Hi,

I'm not understanding all your requirements, but for CF highlight the cell containing the cheapest price, select your D, F, H column data, CF using formula:

=D2=$I2


Excel 2010
ABCDEFGHI
1GoodsPack SizeShop 1price/100gShop 2price/100gShop 3price/100gCheapest price
2apples1kg2.50.254.20.426.30.630.25
Sheet1
Cell Formulas
RangeFormula
D2=C2/10
F2=E2/10
H2=G2/10
I2=MIN(D2,F2,H2)
 
Last edited:
Upvote 0
Hi,

I'm not understanding all your requirements, but for CF highlight the cell containing the cheapest price, select your D, F, H column data, CF using formula:

=D2=$I2

Excel 2010
ABCDEFGHI
1GoodsPack SizeShop 1price/100gShop 2price/100gShop 3price/100gCheapest price
2apples1kg2.50.254.20.426.30.630.25

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D2=C2/10
F2=E2/10
H2=G2/10
I2=MIN(D2,F2,H2)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Hi there

Thank you for your reply.

It's the'Cheapest Price' column that I need to highlight based on the values returned in the three 'Price/100g' columns.

So, if the cheapest price/100g is
shop 1 - turn the 'Cheapest Price' cell blue
shop 2 - turn the 'Cheapest Price' cell green
shop 3 - turn the 'Cheapest Price' cell red

Hope that makes a better sense?

Thanks
Silver
 
Upvote 0
OK, I see:


Excel 2010
ABCDEFGHIJKL
1GoodsPack SizeShop 1price/100gShop 2price/100gShop 3price/100gCheapest priceCF Formulas for Column I
2apples1kg2.50.254.20.426.30.630.25BlueTRUE
3GreenFALSE
4RedFALSE
Sheet1
Cell Formulas
RangeFormula
L2=I2=D2
L3=I2=F2
L4=I2=H2


You need 3 separate CF rules for I2, so CF I2, using formula (as indicated above in L2, L3, L4), Format Fill as desired.
Then you copy the CF formatting down Column I with "Format Painter"
 
Last edited:
Upvote 0
OK, I see:

Excel 2010
ABCDEFGHIJKL
1GoodsPack SizeShop 1price/100gShop 2price/100gShop 3price/100gCheapest priceCF Formulas for Column I
2apples1kg2.50.254.20.426.30.630.25BlueTRUE
3GreenFALSE
4RedFALSE

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
L2=I2=D2
L3=I2=F2
L4=I2=H2

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



You need 3 separate CF rules for I2, so CF I2, using formula (as indicated above in L2, L3, L4), Format Fill as desired.
Then you copy the CF formatting down Column I with "Format Painter"




Brilliant! Thank you jtakw :) Much appreciated!
 
Upvote 0

Forum statistics

Threads
1,215,999
Messages
6,128,192
Members
449,431
Latest member
Taekwon

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