Solved

Excel - Compute Third Field Given Two Others

Posted on 2016-08-18
4
53 Views
Last Modified: 2016-08-22
I know how to do this programmatically but I wonder if I can do this using only formulas... it's not obvious to me.

Referring to the image below, I want to be able to calculate the field with no entry when the other two are filled in.
 
The overall formula is Cap Rate = Income / Price... so if someone enters income and price, I'll compute the cap rate, if they enter cap rate and price, I'll compute compute income and so on.
 
At this point, the only way I can see to do it is to have a second set of fields below the first that contain the formulas.  Any other thoughts or am I going to have to add a "Compute" button and a chunk of VBA code?

TIA
 
missing.png
0
Comment
Question by:Wayne Herbert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 47

Assisted Solution

by:Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs) earned 83 total points
ID: 41761749
You could have a formula in each of the 3 cells (which will result in a circular reference), then the user will only have to enter 2 of the 3 values. But that will be a one time thing as the formula will disappear once a value is entered. You will need to do as you thought and use the 2nd set of fields, or VBA.
0
 
LVL 12

Assisted Solution

by:tel2
tel2 earned 83 total points
ID: 41761752
Assuming that people who aren't named "Wayne" can also participate in this...

Would hiding that 2nd set of fields, and putting them to the right of the visible 3, make them any more tolerable, Wayne (Herbert)?
0
 
LVL 23

Assisted Solution

by:yo_bee
yo_bee earned 83 total points
ID: 41761832
You can create a table with three headings Price, Income, Cap. With Price have the formula and as you tab down the formatting and formulas carry down.

Is that what you want to do.
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 251 total points
ID: 41765555
Without VBA, you'll need to have a separate range to display the resulting calculated value.  There are two approaches:
1) have an identical set of cells ("fields" as you described them) with formulas designed to display the inputted and calculated values
2) have a single cell that dynamically labels the calculated field and provides the calculation.

One can add some functionality by both testing the input conditions to ensure that at least two values are input, AND using Conditional Formatting to show that the result is proper.

I've attached a workbook that demonstrates both examples.  In the first, if there are not two (2) values in the Input cells, then the bottom section will turn black and a message "Cannot Calculate" will appear. In the second, there is only one box that shows the value to be calculated and will also display "Cannot Calculate" if there are not two input values.

VBA would let you do all this with one set of Input/Result cells.

Regards,
Glenn
EE_Q_28964252.xlsx
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question