# Linking two values, then to be able to change one to see how the other is affected

#### mpeters87

##### New Member
Hi there,

I’ve been struggling to figure this out, and I’d appreciate any help.

I have a very basic table. One column is the name of products, the second column how many were sold, and the third column how much money was made off those sales. I’d like to set up away to link the two values. I’d then like to be able to change the value in the number sold to see how it would affect the money made, and to be able to set a money made target, to be able to see how many would need to be sold to make that much money.

Writing out it seems so simple but I’m just not familiar with how to do this. I’ve attached an example worksheet. Let's assume the columns are A, B and C.

Note: the actual sheet I’d be using uses vlookups to populate the cells, but I have left them as values for the sake of this.

 Quantity Profit Sesame Seeds 4,500 31 Quinoa 4,800 960 Bulgur & Quinoa 594 650 Monkey Nuts 2,520 1,246 Peanuts R&S 3,024 978 Macedonian 11,880 2,793 Onassis Giant Beans 2,288 627

<colgroup><col width="169" style="width: 127pt; mso-width-source: userset; mso-width-alt: 6180;"><colgroup><col width="64" style="width: 48pt;" span="2"><tbody>
</tbody>

### Excel Facts

Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

##### Well-known Member
A cell can either be a value or a formula (unless you use VBA) so I'd leave your three columns unchanged and add three more for overrides and results:

ABCDEF
1QuantityProfitOverride QuantityOverride ProfitMessage
2Sesame Seeds4,5003150,000Sales of 50000 gives profit of 344
3Quinoa4,8009602,500Profit of 2500 needs sales of 12500
4Bulgur & Quinoa594650
5Monkey Nuts2,5201,246
6Peanuts R&S3,02497825,000Sales of 25000 gives profit of 8085
7Macedonian11,8802,793
8Onassis Giant Beans2,2886271,000Profit of 1000 needs sales of 3649

</tbody>
mpeters87

Worksheet Formulas
CellFormula
F2 and down
=IF(E2&D2="","",IF(D2="","Profit of "&E2&" needs sales of "&INT((B2/C2)*E2),"Sales of "&D2&" gives profit of "&INT(D2/(B2/C2))))

</tbody>

<tbody>
</tbody>

I could add a check that you don't enter both overrides and I could use TEXT to format the number results but I'll keep it simple.

1,171,630
Messages
5,876,545
Members
433,199
Latest member
guerin47

### 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.

### Which adblocker are you using?

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

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