I have created an interest rate model in excel that contains a stochastic part created by the NORMINV() command. However sometimes I get the error #NUM!. I would like to know how I can create a function that assigns a certain value to cells with the text #NUM! in them.
I have tried a IF function but it didnt work as it didnt see #NUM! as a logical outcome, e,g, IF(B3=#NUM!, "2").
Or perhaps I just missunderstood.
Thank you in advance!
Use IFERROR()
For example IFERROR(B3;"2")
Related
I am using the formula shown in the picture and what I want it to do is average the MinOscilation value categorised by date. That way for example I can get an average for everything on 30/04/2021, 04/05/2021 and like that) but when I try to do that I get an #DIV/0! error and I'm not sure exactly what I am doing wrong.
The syntax you are using is for the AVERAGEIFS function. So either use that, or switch the arguments to the correct order for AVERAGEIF:
=AVERAGEIF($G$22:$G$36,G40,$H$22:$H$36)
I have tried 2 approaches to my problem and can't quite figure out where I'm going wrong.
=AVERAGEIFS(CALC!L:L,CALC!C:C,Consignee!A2,CALC!K:K,CALC!A:A) and =IF(AND(Consignee!A2=CALC!C:C,CALC!K:K=CALC!A:A),AVERAGE(CALC!L:L),0)
Basically I need to start with CONSIGNEE!A2, then find it's match in CALC!C:C, which I then need to check against CALC!A:A to find the ones that go with it in the same row and see if that/those cell(s) match any in CALC!K:K and then take the average of the corresponding values in CALC!L:L and average them. I hope that makes sense. I feel like I've gotten close but am missing something.
Thank you in advance for your help!
I suspect that the formula below may not be the most efficient possible but it will do the job.
=SUMPRODUCT((CALC!A:A=CALC!K:K)*(CALC!C:C=CONSIGNEE!A2),CALC!L:L)/SUMPRODUCT((CALC!A:A=CALC!K:K)*(CALC!C:C=CONSIGNEE!A2))
Edit
In my original answer a reference to L1 was erroneously left over from the formula I tested where I had L1 taking the place of CONSIGNEE!A2. I have corrected this error and believe that the formula works fine for your requirement now.
Note that there are two separate SUMPRODUCT functions which you can test each by itself, one returning the count, the other the sum. If the count = 0 a #DIV/0 error will occur. You can prevent that by embedding the formula in and IFERROR() function.
I'm trying to find the highest score individuals achieved on a test, given that they failed the test, and I want to be able to use filters to narrow down to certain groups of individuals, which I've tried using the SUBTOTAL function to achieve.
Here's what I've tried so far:
SUMPRODUCT(SUBTOTAL(104,OFFSET(INDEX(TOTAL,1),ROW(TOTAL)-ROW(INDEX(TOTAL,1)),0,1)),--(PASS_FAIL="FAIL"))
'TOTAL' and 'PASS_FAIL' are named ranges for the individual's score on the test and whether they passed or failed it, respectively.
I realized that by using SUMPRODUCT this just takes all of the scores of those that failed the test and adds them together. And I can't find anyway to get anything else to work either.
Any help would be greatly appreciated!
wrap in MAX instead of SUMPRODUCT and multiply the two conditionals:
=MAX(SUBTOTAL(104,OFFSET(C2,ROW(C2:C16)-MIN(ROW(C2:C16)),0,1,1))*(B2:B16="A"))
Depending on one's version this may need to be confirmed with Ctrl-Shift-Enter instead of Enter.
I'm working on some statistics for some classes at my school.
I'm trying to have a formula that will calculate the median of ratings for the different classes. My formula I have is:
=MEDIAN(IF(Table1[Class]="AR",Table1[Rating]))
But I can not figure out why the IF statement doesn't output correctly into the MEDIAN Function.
From what I understand, the IF statement should look through column A's list of classes and see if they are "AR", if they are, they should output that value, if not, then output nothing. (I am aware that the output of nothing is not possible and it will output 0.)
If anyone could help, that would be great!
Picture of Formula In Action
Excel File
Thanks to the help from Scott Craner, the answer is to press CTRL+SHIFT+ENTER when you are finished typing the formula. This will allow the IF statement to be able to output more than one value into the median function, this process is also known as an array.
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).