What if investment

tigerzen

Board Regular
Joined
Mar 8, 2023
Messages
209
Office Version
  1. 365
Platform
  1. Windows
I've been asked how to model the following, if I take out 1 or 2 stocks, can Excel display the output without the stocks taken out? So if something is entered into rows 13 and/or 14 then an output like what is in column G to J is produced, this shows the impact of removing the 2 stocks namely B and C. Looking for a formula/function solution that will work on Excel 2019.

Shares what if.xlsx
BCDEFGHIJ
2NamePurchase PriceCurrent valueReturnNamePurchase PriceCurrent valueReturn
3Stock A$ 800$ 1,00080%Stock A$ 800$ 1,00080%
4Stock B$ 400$ 60067%Stock D$ 250$ 50050%
5Stock C$ 600$ 80075%Total$ 1,050$ 1,50070%
6Stock D$ 250$ 50050%
7Total$ 2,050$ 2,90071%
8
9
10
11
12Impact of selling
13Stock B40060067%
14Stock C60080075%
Sheet1
Cell Formulas
RangeFormula
E3:E7,J3:J5J3=H3/I3
H5:I5H5=SUM(H3:H4)
C7:D7C7=SUM(C3:C6)
C13:C14C13=VLOOKUP(B13,$B$3:$E$6,2,FALSE)
D13:D14D13=VLOOKUP(B13,$B$3:$E$6,3,FALSE)
E13:E14E13=VLOOKUP(B13,$B$3:$E$6,4,FALSE)
Cells with Data Validation
CellAllowCriteria
B13:B14List=$B$3:$B$6
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try to use COUNTIF to define names in table 1, those are NOT in table 2, then using INDEX to get name

Book1.xlsx
BCDEFGHIJ
2NamePurchase PriceCurrent valueReturnNamePurchase PriceCurrent valueReturn
3Stock A$ 800$ 1,000#VALUE!Stock A$ 800$ 1,000#VALUE!
4Stock B$ 400$ 600#VALUE!Stock D$ 250$ 500#VALUE!
5Stock C$ 600$ 800#VALUE!Total00#DIV/0!
6Stock D$ 250$ 500#VALUE!
7Total00#DIV/0!
8
9
10
11
12Impact of selling
13Stock B$ 400$ 600 
14Stock C$ 600$ 800 
15    
16    
17    
18    
Sheet2
Cell Formulas
RangeFormula
E3:E7,J3:J5J3=H3/I3
H5:I5H5=SUM(H3:H4)
C7:D7C7=SUM(C3:C6)
B13:B18B13=IFERROR(INDEX(B:B,AGGREGATE(15,6,ROW($B$3:$B$6)/(COUNTIF($G$3:$G$4,$B$3:$B$6)=0),ROWS($1:1))),"")
C13:E18C13=IFERROR(VLOOKUP($B13,$B$3:$E$6,COLUMNS($A:B),FALSE),"")
 
Upvote 0
Thanks Bebo, I think I can adapt your formula to work for my situation as yours might be the other way around to mine. In mine, the output in columns G to J need to be formula-derived. The idea being that one selects a stock from a drop-down box and the output is generated in G to J.

When I first came across this issue I automatically thought SUMIFS or FILTER function. Couldn't get either to quite finish the problem.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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