I am trying to do an IRR formula by group. However my formula keeps giving an error.
=IF(A2=A1," ",+XIRR(G:G,D:D,-0.1))
Can you please assist?
Update: After the PO added his data:
The XIRR range parameters should be something like C2:C12 and B2:B12, not an entire column.
Try the formula below:
=IF(A2=A1," ",XIRR(C2:C12,B2:B12,-0.1))
B.T.W - in your title and your post you mention IRR function, but in your code you have XIRR, so which one are you trying to use ?
Some guesses:
Are you expecting a positive IRR? (That is the usual sign, so give a positive number as the last parameter)
Are the dates in date format? (As opposed to text - Check that by pressing Ctrl+Shift+1 you can see numbers)
Are the value numbers or empty?
The best would be, however, to see a screenshot of your worksheet and what exactly the the error is (e.g. #VALUE!, #REF!).
Update
You have the title row (Valuta and CCY conv) inside the referred range, these text data cause the problem, remove them by referring to C2:C12 and B2:B12 instead of C:C and C2:C12.
Update 2
I was experimenting how you could get a #NUMBER! error if you referred to C2:c12 instead of C:C.
Please make sure that the first number in the row is negative (I think the business logic behind this rule is that it is considered to be the initial investment value).
Related
I am trying to create a formula that checks for several things at the same time but I am having trouble with one part of it.
The formula is the following:
=IF(COUNTIFS($N$2:$N$17095,N3,$K$2:$K$17095,"<>"&"")>6,
IF((SUMPRODUCT(--(ROUND($K$2:$K$49,2)=ROUND(K3,2)))>9),"Always Late / Possible Automation",
IF(COUNTIFS($N$2:$N$17088,N3,$K$2:$K$17088,"<3.5")>0,"Delivered Earlier At Least Once",IF(COUNTIFS($N$2:$N$17088,N3,$K$2:$K$17088,">3.5")>6,"Always Late","False"))))
The first part checks how many entries in the range having the same value as it is in cell N3 have values different to blank and we want those to be more than 6.
Second part is the tough one, it is supposed to check how many values in the rounded range match the rounded value in cell K3. The issue is the formula checks the whole range and I want to check only for the values which match N3 (in essence like the CountIf works only for that value).
The rest is not so relevant.
Some example data:
![enter image description here][1]
As you see in the end of the table the formula with the rounding works but only because I have limited the data shown to 3 unique values in column N. Even here though if i have a blank it doesnt work becaus ei haven't considered it.
Thanks in advance.
Assuming you have Office 365 compatibility/Excel version, use a bunch of filters. To avoid an unwieldy formula I've extended ranges to maximum number of rows (customize as required)...
=LET(x_,$E$3:$E$25,a_,FILTER($E$3:$E$25,--(x_=E3)),b_,FILTER($B$3:$B$25,--(x_=E3)),IF(SUM(--(a_=E3)*(b_<>""))>6,IF((SUMPRODUCT(--(ROUND(b_,2)=ROUND(B3,2)))>9),"Always Late / Possible Automation",IF(SUM(--(a_=E3)*(b_<3.5))>0,"Delivered Earlier At Least Once",IF(SUM(--(a_=E3)*(b_>3.5))>6,"Always Late","False")))))
Note: filter does not appear to work too well within countifs for some reason (must be related to syntax RE: arrays vs. criteria TBC). Thus have replaced countifs(filter_range,X) eqn 'types' with sum(--(filter_range=X)) which works as intended.
I don't have any experience with creating excel data validation formulas.
I have 2 code formulas, which are generated in java code, which are coming from excel data validations:
COUNTA('User Input Sheet'!A:A)-4
IF(COUNTA(INDIRECT(ADDRESS(ROW(A5),COLUMN(A5),1,1,"User Input Sheet") & ":" & ADDRESS(ROW(AJ5),COLUMN(AJ5))))=0, "","POP")
Can someone help me how to write the data validation formula for the above two, as I have to use for different cells, but don't know how to put in cell data validation ?
Providing more information on what it is you're actually trying to do, will help you, as well as helping anyone who's trying to help you. e.g.:
Your 1st formula returns the number of non-empty cells in column A of a sheet, less 4.
But you don't say if the cell being validated needs to be more, less, the same or not the same as that. If you know the answer to that, the formula as is (with = in front) will work directly in the Data Validation 'value range' fields. e.g.:
The above example validates that a cell value is between zero and the results of the formula.
Suggest adapting and applying that, and if you're not getting the expect result, explain what you were aiming for, what you did, and what the results are.
=====================================================
The second formula is more problematic in terms of trying to guess what it is you're trying to do.
One thing I'll point out first thought: it uses INDIRECT in a completely unnecessary way (and that's inherently unwise). So the first thing to do is covert to a direct reference per:
=IF(COUNTA('User Input Sheet'!A5:J5)=0, "","POP")
But even then, you have a formula that returns a zero-length string ("") or literal 'POP' (based on A5:J5 being empty or not).
And it's unclear how you intend to use that to validate a cell. One guess would be the user has to enter "POP" or nothing (depending on A5:J5 being populated or not). But that seems to be an odd thing to do.
I have a bank export of Credit card vendors. As these vary, I use unique strings contained in each to identify them. For example here is a lookup table excerpt.
First Lookup
I then apply a formula =INDEX(First_level,MATCH(TRUE,ISNUMBER(SEARCH(Keywords,C3374)),0)) to produce this:
First calc
I found this formula here https://exceljet.net/formula/get-first-match-cell-contains
Then I reapply the formula to the result ie the First_Level using this formula =INDEX(Second_Level,MATCH(TRUE,ISNUMBER(SEARCH(Frst_Lev_Check,H44)),0)) with this Lookup.
Second Lookup
Most of the time it works, but for this I get the following
Second calc, where the first level classification is correct, but the second level one is completely wrong.
When I've gone into the depths of the formula, the issue is that the Search function is returning the wrong value.
This appears to be a known issue: https://answers.microsoft.com/en-us/msoffice/forum/all/how-to-use-named-range-in-search-function/14c8c989-bed0-48f9-bce0-c0894571b557
Ideas welcome on workarounds/how to solve the problem.
Cheers Jon
Would you consider:
=MATCH("Apple",List)
and
=MATCH("Pear",List)
to return 1 and 2 respectively.
A couple of things in regards to your question:
The correct syntax for search is =SEARCH(find_text,within_text), so the correct formula would be =SEARCH("Pear",List).
The reason why you are getting the #Value is, because you are applying search to a range, but the function is only intended for cells.
The best ways to see if a value exists in a range are the countif and match function:
The countif function shows you how many times the a value is in a range:
The match function shows you in which row the the first value is:
I'm making a summary of a list of tasks, and the corresponding dates (start date, first answer date, ...).
It looks more or less like the following:
Title Start date First answer
Task1 29/06/2018 02/07/2018
Task2 09/05/2018
Task3 13/06/2018 14/06/2018
I would like to calculate the average time, needed for the first answer to be given. In case no first answer is given yet, this entry needs to be ignored in the calculation of the average.
In order to be able to understand the formulas better, I've decided to use names for the headers, like:
Name "Header_Title" has value "Title"
Name "Header_Start_Date" has value "Start Date"
Name "Header_First_Answer" has value "First answer"
Also, the number of entries, defined as COUNTA(OFFSET(Header_Title;1;0):A1048576) has a name: Total_Count.
Next to that, I've created names for the ranges of the column values:
"All_Start_Dates" is defined as =OFFSET(Header_Start_Date;1;0):OFFSET(Header_Start_Date;Total_Count;0)
"All_First_Answered" is defined as =OFFSET(Header_First_Answer;1;0):OFFSET(Header_First_Answer;Total_Count;0)
Explanation : take the first entry under the header (column title) and go to the row, corresponding to the last task.
This makes it very easy to write a formula for calculating the average difference between those date columns:
{=AVERAGE(All_First_Answered_Dates-All_Start_Dates)}
// mind the {} for showing this is an array formula
Now the problem is: how to use the AverageIf worksheet function in order not to take into account the cases where First answer is not filled in?
I already tried using ">0" and ">"&0, but this does not work, the formulas are said not to be valid:
{=AVERAGEIF(All_First_Answered_Dates-All_Start_Dates;">0")}
{=AVERAGEIF(All_First_Answered_Dates-All_Start_Dates;">"&0)}
Does anybody have an idea?
Thanks in advance
P.s.1. As you can see, I'm using cell range A1048576 as the last entry of column A, does anybody know a more elegant way to describe this?
P.s.2. One extra thing, which would make my life easier, is the possibility to see which cells have a name (I was thinking about conditional formatting, but I didn't find the way to do this). Does anybody know if there is a way to highlight individual cells, linked to a name?
So my suggested answer would be
=AVERAGEIF(All_First_Answered,">0")-AVERAGEIF(All_First_Answered,">0",All_Start_Dates)
I'm assuming here that all start dates are present but first answered dates may be missing: you could easily add an extra condition for start date if you used AVERAGEIFS. Both parts of the formula include the same conditions so they are working on the same rows.
The intermediate columns above are just included by way of explanation.
Try an array formula.
If you're not familiar with array formulas, the significant difference is you press and hold Ctrl+Shift then hit Enter instead of just pressing Enter. You will see the formula preceded and followed by curly brackets. Do not type those. Those will appear automatically.
=AVERAGE(IF(INDIRECT("C14:C"&LOOKUP(2,1/(A:A<>""),ROW(A:A)))=0,"",INDIRECT("C14:C"&LOOKUP(2,1/(A:A<>""),ROW(A:A)))-INDIRECT("B14:B"&LOOKUP(2,1/(A:A<>""),ROW(A:A)))))
I am trying to write a formula that checks the status and name to be ongoing and joe blogs (in this example), and once finding a match, will identify the oldest date of a ticket raised.
My formula currently includes:
=MIN(IF('Sheet2'!AA:AA="ONGOING",IF('Sheet2'!Q:Q="Joe Bloggs",'Sheet2'!B18:B49)))
I also tried:
=IF((AND(sheet2!$AA:$AA="ongoing", 'Sheet2'!$Q:$Q="Joe Bloggs")), MIN('Sheet2'!B18:B49),"No")
In Column B contains dates. Q contains names, AA contains the status.
At the moment when this runs I get the result '00/01/1990'.
I have done some checks to find the error, and appears to be around the targets name, as when the second formula is tried, the output is "no". The name is definitely in the Q column, and I have completed other formulas including countifs which have worked perfectly fine.
I have done a lot of searching to find nested ifs and min statements to have no joy , would be grateful of any advice / tips. It may be a simple error to some.
Try entering this as an array formula:
=MIN(IF(sheet2!AA:AA="ongoing",IF(sheet2!q:q="Joe Bloggs",sheet2!B:B)))
FYI I found the solution here.
You will have to apply a date format to the result.
Your first formula works well on my data (as below). If I close the formula with ENTER only, I get the result '37128' and if I close the formula with CTRL+SHIFT+ENTER I get the expected result, '25/08/2001'.
Edit: As #FocusWiz said in the comments, the only major difference (other than different column names) between my formula and yours is the the last range in your formula (B18:B49) is a different sized range to the other two, which are referring to full columns.
*This could be solved either by using the same row range for all three column references (AA18:AA49, Q18:Q49, B18:B49) or referencing the full column range for all three ranges (AA:AA,Q:Q,B:B).
This is your formula I'm talking about:
=MIN(IF('Sheet2'!AA:AA="ONGOING",IF('Sheet2'!Q:Q="Joe Bloggs",'Sheet2'!B18:B49)))
And this is the formula in my workbook F7:
=MIN(IF(B:B="ONGOING",IF(A:A="Joe Bloggs",C:C)))
As you can see in the formula editor, squiggly brackets '{}' show around the formula when it has been closed as an array formula.
If that doesn't work for you, please post some sample data with datatypes so we can help figure out what is causing the lookup value to miss the data.
While I like the technique offered by Patrick (I have frequently forgotten an "else" portion of a formula and gotten "false" as a value in a cell but never thought of a use for that...thank you!), I think this question highlights an issue we all can have with array formulas. As girlvsdata indicates, your original formula:
=MIN(IF(Sheet2!AA:AA="ONGOING",IF(Sheet2!Q:Q="Joe Bloggs",Sheet2!B:B)))
(modified above to be more generic for column B) will also work when entered as an array formula.
What likely happened is that somehow the formula got edited and was not re-entered as an array formula.
While I do not dislike array formulas, I do try to avoid them because I have fat fingers and will frequently mess them up by accidentally hitting the wrong key as I am modifying other cells.
Here is an alternative without using an array formula:
=INDEX(LARGE((Sheet2!Q:Q&Sheet2!AA:AA="Joe bloggs"&"ongoing")*(Sheet2!B:B),COUNTIFS(Sheet2!Q:Q,"Joe Bloggs",Sheet2!AA:AA,"ongoing")),1)
What it does is basically create a candidate date value for every row that has "joe bloggs" and "ongoing" which is equal to the date in column B for all such rows. All other rows get a zero candidate date value. The LARGE function takes the smallest nonzero date by counting the n valid candidates with the COUNTIFS function and taking the nth largest such candidate.