"Investment Formula"

Marwan69

Board Regular
Joined
Mar 14, 2018
Messages
80
Dear All,

Good day/night.

I have a tabulate consisting of the following inputs:
Beg. Value(A1)
Purchases
(B1)
Sales
(C1)
End. Value(D1)
Formula(E1)=If(....

I'd like to create a formula to be able to divide the (Ending value/Beg. value) -1, but with slight adjustment. I'll explain:

Sometimes there's 0 value under one or two of the first three captions (Beg. Value, Purchases, or Sales) and i want my formula to capture that. Hope that's clear.

Many thanks,
Marwan
 
Last edited:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try:

Code:
=IF(PRODUCT($A$1:$C$1)=0,"Zero Value",(D1/A1)-1)
 
Upvote 0
Dear AhoyNC,

Thanks for your help.

Actually I'm not trying to multiply these cells. These cells have values and I need to adjust my formula to accommodate the different scenarios of these values. Meaning:

If there's an amount say: $100 under the beginning value, $150 under purchases, (-$100) under sales. How would I build up my formula to capture all these inputs, taking that sometimes one or more of these values = 0.

I tries the following formula:

IF(OR(A1<>0,B1<>0,C1<>0),(D1/A1))-1,0)

But didn't work, because there's a case that there's not any value under A1 or B1, or both have 0, or some have values and some have 0!
It's a mess for me!

Hope I made it clear through these examples.

Many thanks,
Marwan
 
Last edited:
Upvote 0
By multiplying the cells if any one or more of them equals zero the IF statement will return zero.
You could also change the OR in your formula to AND.
Excel Workbook
ABCDEFG
1100150-1001250.250.25
21000-10012500
30150012500
40150-10012500
Sheet
 
Upvote 0
IF(OR(A1<>0,B1<>0,C1<>0),(D1/A1))-1,0)
But didn't work

Presumably it is okay to have zero purchases (B1) or zero sales (C1) or even both (!) in any perriod. The only problem is when the beginning balance (A1) is zero.

So you might do one of the following:

=IFERROR(D1/A1 - 1, 0)
or
=IF(OR(A1=0,A1=""), 0, D1/A1 - 1)
or
=IF(OR(A1={0,""}), 0, D1/A1 - 1)

formatted as Percentage.

Both formula also handle the condition when A1 appears to be blank, either because it is empty (no value) or because its value is the null string ("").

Those formulas make the simplifying assumption that neither the beginning balance (A1) nor the ending balance (D1) can be negative.

Is that a valid assumption?
 
Upvote 0
Thanks AhoyNC,

The point with your formula sir is if there's not value in B or C, the formula will return 0! when in fact I still want the formula to divide: D/A.

Actually this is pertaining to investment performance, where I want excel to add the purchases(B) and subtract the sales(C) from the beginning and ending balances. I'll explain:

The formula in E cell should be as follows:

E: (D-(B+C))/(A+(B-C)).

The problem here is when I have 0 value under A the formula corrupts. On the other hand, if I have 0 value under B or C, I still want to divide D/A even if these cells (B,C) have 0 values.

Many thanks for your effort.

 
Last edited:
Upvote 0
Dear Joeu2004,

Thanks for your reply and effort.

The formula =IF(OR(A1=0,A1=""), 0, D1/A1 - 1) still doesn't count the values in B & C, no does it count if these values where 0.

My ultimate formula should read as follows:

The formula in E cell should be as follows (Under E):

E: (D-(B+C))/(A+(B-C)).


Many thanks,
Marwan


 
Upvote 0
If you would provide several examples that cover the cases of interest, someone could understand what you want.
 
Upvote 0
HiShg,





CDEFGH
47,0000007,00044
53,0000003,00019
63,0000003,0000
710,00000010,00080
805,000005,0000
9000000
103,66300-113,65235
113,7180003,71856
1213,3485,0001,958020,3061,958
131,9230001,9230
145,053034205,395342
152,440029402,734294
162,406040902,815409
17000000
185,03802405,06224
1962601-62701
20020,0000020,0000
2120,0500120020,170120
22000000
2321,59810,00078031,67678
24000000
25000000
26000000
2710,57600010,57677
CellFormula
G43000
G53000
G610000
G710,000
G80
G93641
G103718

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>

I want to calculate G/C-1 provided that adjustments for Purchases & Sales should be reflected in the G&C. The issue is sometimes there isn't any value in the Purchases and/sales which will return the formula to #value error. And what makes it even worse is when there isn't value under the C as shown in row#20 above.

Hope is clear.

Many thanks,
Marwan
 
Upvote 0

Forum statistics

Threads
1,213,561
Messages
6,114,316
Members
448,564
Latest member
ED38

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