Format a cell if used in a formula

MartinL

Well-known Member
Joined
Oct 16, 2008
Messages
1,137
Office Version
  1. 365
Platform
  1. Windows
I have a range of cells containing currency conversion values and their corresponding currencies
I then have a table which points to the selected currency factor.
I'd like to highlight the currency cell used in the table - if that's possible.
Cells C1:D3
EURO14
GBP15
USD16

Table1 Cells B7:D8
SKUQTYPrice
10000001231123.99
Price contains the formula
VLOOKUP($B7,'Pricing'!$A:$R,D$1,0)

In this instance I'd like Cell C1 to be highlighted so that it can be seen that EURO's are being used
But if someone changes the formula to GBP 14 (cell D2) or USD 15 (cell D3)
Then I'd like C2 or C2 to be highlighted
As a workaround D1, D2 or D3 could be highlighted instead.
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
17,087
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
@Marcelo Branco : I'm obviously doing something wrong as I cannot get your solution to work at all

Martin

Lets try again

You didn't answer my questions. Please, clarify
Is the formula, that gets the price from the sheet Pricing, in D8?
If so, is it exactly?
=VLOOKUP(B8,Pricing!$A:$R,D1,0)

M.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
17,087
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Martin,

Looks like you already have a solution, so please disregard my post above.

Either I didn't understand your problem correctly or something strange is happening while implementing my solution in your spreadsheet.

Merry Christmas

M.
 

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
6,177
Office Version
  1. 365
Platform
  1. MacOS

Marcelo Branco

May have a better solution, as mine is volatile with indirect() which every time you do anything on the spreadsheet it will recalculate

my solution wont work if its
=VLOOKUP(B8,Pricing!$A:$R,D1,0)
and NOT
=VLOOKUP(B8,Pricing!$A:$R,D$1,0)
Note you had a $ in your original post
so the -5
gets back to the D
and extract 3 characters D$1
if its ONLY
D1 and not D$1
then its back -4 and Only extract 2
=INDIRECT(MID(FORMULATEXT($A$7),LEN(FORMULATEXT($A$7))-4,2))
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
17,087
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows

@Marcelo Branco​

May have a better solution, as mine is volatile with indirect() which every time you do anything on the spreadsheet it will recalculate

Hi Etaf

Have you tried my solution (suggestion)? It worked?

M.
 

etaf

Well-known Member
Joined
Oct 24, 2012
Messages
6,177
Office Version
  1. 365
Platform
  1. MacOS
Have you tried my solution (suggestion)? It worked?
no i didn't try , but sure it was ok,
I can have a look now
 

Marcelo Branco

MrExcel MVP
Joined
Aug 23, 2010
Messages
17,087
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Another possible solution without volatile functions

Pricing sheet
Pasta1
ABCDEFGHIJKLMNOPQR
1SKUCol2Col3Col4Col5Col6Col7Col8Col9Col10Col11Col12Col13EUROGPBUSDCol17Col18
21000000123123,9999,78128,77
3
Pricing



Sheet of interest
Select C1:D3

Formula used in CF in English
=MATCH($D$8,INDEX(Pricing!$A:$R,MATCH($B$8,Pricing!$A:$A,0),0),0)=$D1

Scenario 1
Formula in D8
=VLOOKUP(B8,Pricing!$A:$R,D1,0)
Pasta1
BCD
1EURO14
2GBP15
3USD16
4
5
6
7SKUQTYPrice
810000001231123,99
Plan1
Cell Formulas
RangeFormula
D8D8=VLOOKUP(B8,Pricing!$A:$R,D1,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:D3Expression=CORRESP($D$8;ÍNDICE(Pricing!$A:$R;CORRESP($B$8;Pricing!$A:$A;0);0);0)=$D1textNO


Scenario 2
Formula in D8
=VLOOKUP(B8,Pricing!$A:$R,D2,0)

Pasta1
BCD
1EURO14
2GBP15
3USD16
4
5
6
7SKUQTYPrice
81000000123199,78
Plan1
Cell Formulas
RangeFormula
D8D8=VLOOKUP(B8,Pricing!$A:$R,D2,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:D3Expression=CORRESP($D$8;ÍNDICE(Pricing!$A:$R;CORRESP($B$8;Pricing!$A:$A;0);0);0)=$D1textNO


Scenario 3
Formula in D8
=VLOOKUP(B8,Pricing!$A:$R,D3,0)

Pasta1
BCD
1EURO14
2GBP15
3USD16
4
5
6
7SKUQTYPrice
810000001231128,77
Plan1
Cell Formulas
RangeFormula
D8D8=VLOOKUP(B8,Pricing!$A:$R,D3,0)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C1:D3Expression=CORRESP($D$8;ÍNDICE(Pricing!$A:$R;CORRESP($B$8;Pricing!$A:$A;0);0);0)=$D1textNO


M.
 

Forum statistics

Threads
1,176,507
Messages
5,903,450
Members
435,030
Latest member
zechariah

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
Top