XIRR Formulae For each investment - excel

I am trying to apply an XIRR Formulae so that the percentage of each investment is calculated separately. I attempted an IF formulea an was not successful. I need to amend the below formulae. This will be useful as i am trying to apply it to 200 invesmtents plus.
=XIRR(C2:C17,B2:B17)
Below is the data.
Below is the result i am trying to get.

There are some problems of your data setup. Here is how the IRR works (http://www.investopedia.com/ask/answers/022615/what-formula-calculating-internal-rate-return-irr-excel.asp). Without your data, here is how you can make this to work for matching different investments.
See the attached image below and assume you are entering the formula from cell F2 and here you go:
=XIRR(OFFSET($C$1,MATCH(E2,$A$2:$A$17,0),0,COUNTIF($A$2:$A$17,E2)),OFFSET($B$1,MATCH(E2,$A$2:$A$17,0),0,COUNTIF($A$2:$A$17,E2)))
Please note this is an array formula (need to click Ctrl + Shift + Enter together)).
What I did is to use OFFSET to find the pertaining ranges for dates and values of each investment. And here I have also showed you the results for a valid data inputs. Try and let me know.

pivottable can do it easily.It's not good for U?

Related

Excel formula using countif on sample data

We want to find out how many Data00_A_Up and Data00_B_Up is there , we are not concerned about the digit which comes after A and B like A1,A2,B1,B2 and all. For all Data, that is Data00,Data01,...so on we need to find out how many Data_A_Up and Data_B_Up is there using formula in excel. I came up with this formula
=COUNTIF(A1:C10,"Data00_A?_Up")
this will give total A_Up for Data00. Similarly
=COUNTIF(A1:C10,"Data01_B?_Up")
this will give total number of B_Up for Data01.
Each time we have to edit this formula to Data01,Data02,etc. So is there any one formula to calculate everything at once.
Dataset
With Microsoft 365 you may try below formula to count Up for Data00, Data01...
=LET(x,UNIQUE(LEFT(A1:A10,SEARCH("_",A1:A10)-1)),CHOOSE({1,2},x,COUNTIFS(A1:A10,x&"*",A1:A10,"*Up")))
If you need to distinguish A and B then could try-
=LET(x,UNIQUE(LEFT(A1:A10,8)),CHOOSE({1,2},x,COUNTIFS(A1:A10,x&"*",A1:A10,"*Up")))

Excel calculate SUM of differences when cell addresses are not fixed

In Excel I have a list of employees (see image) and I want to store their salary update history. For each salary update, I want to calculate the difference in their total salary. I'm unable to create a formula to calculate this and SUM() the updates per period for me.
The image below demonstrates my spreadsheet and the desired salary update total (I did calculations manually, bet need a formula for this). In reality, there will be a few dozens of employees, so the requirement for the formula is to be dynamic and not contain manual "+" for each row.
NOTE: For some people their salary can stay unchanged and there are not any values in some cells. It's the main challenge, since we have to find the value of the "previous salary" for an employee, because it's not necessary stored in the previous cell. Otherwise, I could have used a simple array formula, like:
{=SUM(G3:G6-H3:H6)}. But unfortunately, it does not work in this case (there can be no value in the H column, so we have to find where it actually is).
Also, the formula should work correctly with filtering: is some row is filtered out (person is inactive, see picture), this row/cell should be ignored.
Can anybody help me with this formula that I'm struggling with?
This will do what you ask, not my my best work.Column "I"is still =SUM. Remember to press Ctrl + shift + enter. Then drag the formula where you want it to apply.
{=IFERROR(IF(E3="",E3,E3-INDEX(F3:$I$3,MATCH(FALSE,ISBLANK(F3:$I$3),0)))
+IF(E4="",E4,E4-INDEX(F4:$I$4,MATCH(FALSE,ISBLANK(F4:$I$4),0)))
+IF(E5="",E5,E5-INDEX(F5:$I$5,MATCH(FALSE,ISBLANK(F5:$I$5),0)))
+IF(E6="",E6,E6-INDEX(F6:$I$6,MATCH(FALSE,ISBLANK(F6:$I$6),0)));SUM(E3:E6))}
This formula does give the same answers as yours on the test data as below, BUT it is making a very big assumption - that the last recorded salary is always the largest one.
=SUM(IF(D3:D6="",0,D3:D6-SUBTOTAL(4,OFFSET(E3,ROW(D3:D6)-ROW(D3),0,1,COLUMNS(E3:$J3)))))
Must be entered as an array formula using CtrlShiftEnter
If you want to ignore hidden rows, plz use the form of Subtotal that ignores hidden cells
=SUM(IF(D3:D6="",0,SUBTOTAL(104,OFFSET(D3,ROW(D3:D6)-ROW(D3),0,1,1))-SUBTOTAL(104,OFFSET(E3,ROW(D3:D6)-ROW(D3),0,1,COLUMNS(E3:$J3)))))

Using `SUMPRODUCT` without dividing by zero

See the image above for my hypothetical grade sheet in Libre Calc. There are two rows. One contains the points achieved for each assignment while the second records the points available. I would like to keep a running average of the grades, but I do not wish to update the formula for the running average each time a new assignment is added. Currently, I am using:
SUMPRODUCT( ENTIRE_POINTS_ACHIEVED_ROW, 1 / (ENTIRE_POINTS_AVAILABLE_ROW) )
I then find the average by dividing by the number of non-blank rows, using COUNTA().
As you can see above, assignments 1-3 are complete, but there is no information for the fourth. Because of this, I get a divide by zero error. How can I accommodate for this? Or, is there a more straightforward way to achieve what I've described above?
As Scott Craner proposed , using an Array formula is the way to follow. With LO Calc, the following formula should work (enter it with CTRL+SHIFT+ENTER to make it an array formula):
=SUMPRODUCT(IF(B2:E2<>0; B2:E2; "");1/B3:E3)/COUNT(B2:E2)*100
I've adapted an example from the OpenOffice.org Calc documentation for this.
Use this array formula instead:
=SUM(IF($B$3:$E$3<>"",B2:E2/B3:E3))/COUNT(B2:E2)
Being an array it must be confirmed with Ctrl-Shift-Enter. If done properly {} will be put around the formula.
This is excel, It may not work in LibreOffice.

SUMIF for a wider range

I have a problem that has been nagging me for a while now. I am a novice in Excel. Hence excuse me if this comes across as silly.
I have the following array of data:
I need to obtain the sum of values corresponding to the row entry "book".
I have used the formula sumif(B4:F7,"book",C4:F7). However excel returns the value in column c alone (i.e value returned is 10).
Update
I ammended my formula as follows:
I now obtained the correct sum - i.e 70. However, I deal with large volumes of data and using this formula is not efficient. Can anyone suggest a quick workaround for this?
Your guess is correct. There is a simpler way, but it is not easy to find it out for a novice user. You will need to use an array formula to do what you need.
Type this formula:
=SUM(IF($B4:$B7="book",$C$4:$F$7,0))
and enter it using Ctrl + Shift + Enter instead of just Enter
You can see the result in this picture (my delimiter is ; while yours will be ,, but that does not make a difference):

CountIF error with <0

I would need some help again with another excel countif expression. I have the line i2:al2 which contains leftover stock data.I am building a worksheet to calculate remaining stocks in % as per supervisor's wish.
As I am working with %, for example if I say that 90% sales that means we have 103 stock left and with 91% sales I have 100 stock left.
Anyways I got around to count the number of stock left in line i2:a12 using countifs.
Example if I need to calculate leftover stock for sales at 90% which means leftover stock level of 100 to 102. I have used :
=countif(range,">100")-countif(range,">102")
This method seems to work till I reach negative numbers, i.e. oversales. For example, if I try to do the following:
=countif(range,"-100")-countif(range,">0")
the formula seems to stop working. If I count manually using a conditional formatting I get a totally different answer for the oversales.
Maybe I am getting the logic of the countif function wrong. My purpose for the expressison is:
=count(in range, values >=X & <=Y)
As I have only access to excel 2003 I cannot use Countifs method. Anyone could help me on this issue?
Many thanks.
You can use an array formula:
=SUM((range>=x)*(range<=y))
For that to work, you need to press CTRL-SHIFT-ENTER for that to use array formula.
Alternatively, using what simoco gives in the comment works too without having to save as array formula.

Resources