Solution to lookup and pull 'formulas' from a second tab based on variables in another tab

rsturbox

New Member
Joined
May 17, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello, I'd appreciate any thoughts on my question. Was hoping that I can accomplish this without using macros, but open using macros if it's the only way to solve the problem. Here's the scenario: on tab A, I have 3 variables - a, b, and c. The variables will have a unique amount assigned and may be repeated with different amounts. More on column C below.


Column AColumn BColumn C
a$100<result>
b$500<result>
c$2,000<result>
d$400<result>

On tab B, I've assigned unique math formulas to each of the variables. For example, a=x*2; b=x+100; c=x+50. "x" is meant for the amounts from tab A. In my real world problem, I am going to have 50+ variables each with their own unique math formula. All the math formulas are relatively simple.

Is it possible to use a lookup function (e.g., xlookup) to pull the formulas on tab B to compute "results" (Column C) on tab A? Specifically, the formula would first lookup the formulas on tab B based on the variables on tab A. Then, the solution would run the amounts on tab A through the formula to output the result in Column C. Based on my example, the results on tab A, Column C would be:

Column AColumn BColumn C
a$100$200
b$500$600
c$2,000$2,050
a$400$800

Solutions that I've considered are: using the "LET" function. Since LET is a relatively new Excel function, I don't know if it is capable of pulling the formula from tab B and then put it in tab A and then calculate it based on a variable 'x'. I have also used very long if/then statements in the past for each variable, but as you can imagine, the formulas are super long and very inefficient.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
If I use VBA for this, I will do this:
In column A, I will set the cells (Sat A2 to A1000 - these will be the target cells) to react to a Worksheet_Change event.

In the Worksheet_Change procedure, you can use the SELECT CASE statements to immediately update the column C with the calculated value.

This is quite an involved process.
If you wish to try this, I can write out the codes.
 
Upvote 0
Solution
If I use VBA for this, I will do this:
In column A, I will set the cells (Sat A2 to A1000 - these will be the target cells) to react to a Worksheet_Change event.

In the Worksheet_Change procedure, you can use the SELECT CASE statements to immediately update the column C with the calculated value.

This is quite an involved process.
If you wish to try this, I can write out the codes.
thanks for your response! Appreciate the offer, but I don't wish for you to write out the codes. Your response at least confirms with me that there doesn't appear to be a non-VBA solution to my problem.
 
Upvote 0

Forum statistics

Threads
1,215,651
Messages
6,126,027
Members
449,281
Latest member
redwine77

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