Passing a formula with a variable

Beneindias

Board Regular
Joined
Jun 21, 2022
Messages
120
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi guys.

I will try to explain my problem.

I have an excel file with 2 worksheets.

In worksheet 1, I have a table with a column that has a function that goes to worksheet 2, and finds a value in a table.

In this table, I have column with various numbers, but there are two rows with a formula, for example 14*2*(100 - R) where "R" is a value that I have in worksheet 1, in cell $BB9.

Can I have that "R" value pointing to my $BB9 cell and doing the calculations? Or do I need to "hard code" this formula?

So, to simplify:
Worksheet1!A2 -> =worksheet2!D1 [can be D2, D3, D4, it depends]

Worksheet2!D1 = 14*2*(100 - worksheet1!BB9) [it can be BB10, BB11, depends on the table row]

Can anibody help me, please?

Thanks
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hi,
If my understanding is correct, you need Indirect ...
you can test following:
Excel Formula:
=14*2*(100-INDIRECT("sheet1!BB"&ROW()+8))
 
Upvote 0
Hi,
If my understanding is correct, you need Indirect ...
you can test following:
Excel Formula:
=14*2*(100-INDIRECT("sheet1!BB"&ROW()+8))
I think that it's no exactly what I wanted.

This is part os my table in worksheet 1:

Cell Formulas
RangeFormula
BB9:BB10BB9=[@[Total Vencimento Base]]+[@[Total Retroativos]]+[@[Total Horas Extra]]+[@[Total Prémios]]
BC9:BC10BC9=IF(Retencoes!$C$6="","Colocar taxa na página de retenções",Retencoes!$C$6)
BD9:BD10BD9=[@[Total Valores Sujeitos a Desconto]]*[@[Taxa Seg. Social]]
BE9:BE10BE9=IFERROR(INDEX(Tabela1,MATCH(Salarios!$BB9,Tabela1[Remuneração],0),3),IFERROR(INDEX(Tabela1,MATCH(Salarios!$BB9,Tabela1[Remuneração],1)+1,3),0))
BF9:BF10BF9=IF(IFERROR(INDEX(Tabela1,MATCH(Salarios!$BB9,Tabela1[Remuneração],0),1)=2,INDEX(Tabela1,MATCH(Salarios!$BB9,Tabela1[Remuneração],1)+1,1)=2),Retencoes!$E$17,"Não")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B9:BT10Expression=$C9=VERDADEIROtextYES



This is my table in worksheet 2:

vencimentos v2.4.3 - 2 semestre 2023.xlsm
BCDE
14Remuneração Mensal
15EscalãoRemuneraçãoTaxaParcela a abater (€)
161762,00 €0,00%0,00 €
172886,57 €14,50%14,5%*2,3*(1093,31 - R)
183932,14 €21,00%21%*1,3*(1350,22 - R)
194999,14 €21,00%114,14 €
2051 106,93 €26,50%169,09 €
2161 600,36 €28,50%191,23 €
2271 961,36 €35,00%295,26 €
2382 529,05 €37,00%334,48 €
2493 694,46 €38,72%377,86 €
25105 469,90 €40,05%427,18 €
26116 420,55 €42,72%573,22 €
271220 064,21 €44,95%716,08 €
28131 000 000,00 €47,17%1 162,51 €
Retencoes


As you can check, In worksheet 1, column BF, I have a formula that finds the right value in the table that I have in worksheet 2.
The problem is that in line 2 and 3, instead of only a value, we have a formula. in this formula, the value R is the value that I have in my worksheet's 1 column BB.
So, I was looking to have this R dynamic, when it's used in table of worksheet1.

the value R will vary depending on the row in table of worksheet 1.
 
Upvote 0

Forum statistics

Threads
1,223,756
Messages
6,174,320
Members
452,555
Latest member
colc007

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