worksheet-function

XIRR Calculation

☆樱花仙子☆ 提交于 2019-11-28 04:11:08
How do I calculate Excel's XIRR function using C#? According to XIRR function openoffice documentation (formula is same as in excel) you need to solve for XIRR variable in the following f(xirr) equation: You can calculate xirr value by: calculating derivative of above function -> f '(xirr) after having f(xirr) and f'(xirr) you can solve for xirr value by using iterative Newton's method - famous formula-> EDIT I've got a bit of time so, here it is - complete C# code for XIRR calculation: class xirr { public const double tol = 0.001; public delegate double fx(double x); public static fx

IF statement: how to leave cell blank if condition is false (“” does not work)

筅森魡賤 提交于 2019-11-28 04:01:49
I would like to write an IF statement, where the cell is left blank if the condition is FALSE. Note that, if the following formula is entered in C1 ( for which the condition is false ) for example: =IF(A1=1,B1,"") and if C1 is tested for being blank or not using =ISBLANK(C1) , this would return FALSE , even if C1 seems to be blank. This means that the =IF(A1=1,B1,"") formula does not technically leave the cells blank if the condition is not met. Any thoughts as to a way of achieving that? Thanks, Portland Runner Try this instead =IF(ISBLANK(C1),TRUE,(TRIM(C1)="")) This will return true for

Use string value from a cell to access worksheet of same name

寵の児 提交于 2019-11-27 18:28:49
I have 2 worksheets: Summary and SERVER-ONE . In cell A5 on the Summary worksheet, I have added the value SERVER-ONE . Next to it, in cell B5 , I would like a formula that uses the value in A5 to display the value of G7 in the worksheet of the same name ( SERVER-ONE ). I could manually use: ='SERVER-ONE'!G7 However I would like this to be dynamic, so I can easily add more worksheets. I tried the obvious with no joy: ='A5'!G7 Any suggestions? You can use the formula INDIRECT() . This basically takes a string and treats it as a reference. In your case, you would use: =INDIRECT("'"&A5&"'!G7") The

How to extract text within a string of text

丶灬走出姿态 提交于 2019-11-27 14:01:58
I have a simple problem that I'm hoping to resolve without using VBA but if that's the only way it can be solved, so be it. I have a file with multiple rows (all one column). Each row has data that looks something like this: 1 7.82E-13 >gi|297848936|ref|XP_00| 4-hydroxide gi|297338191|gb|23343|randomrandom 2 5.09E-09 >gi|168010496|ref|xp_00| 2-pyruvate etc... What I want is some way to extract the string of numbers that begin with "gi|" and end with a "|". For some rows this might mean as many as 5 gi numbers, for others it'll just be one. What I would hope the output would look like would be

Get the last non-empty cell in a column in Google Sheets

孤街醉人 提交于 2019-11-27 11:09:57
I use the following function =DAYS360(A2, A35) to calculate the difference between two dates in my column. However, the column is ever expanding and I currently have to manually change 'A35' as I update my spreadsheet. Is there a way (in Google Sheets) to find the last non-empty cell in this column and then dynamically set that parameter in the above function? There may be a more eloquent way, but this is the way I came up with: The function to find the last populated cell in a column is: =INDEX( FILTER( A:A ; NOT( ISBLANK( A:A ) ) ) ; ROWS( FILTER( A:A ; NOT( ISBLANK( A:A ) ) ) ) ) So if you

Get parent folder path from file path using cell formula

放肆的年华 提交于 2019-11-27 09:18:50
In column A I have 20000 rows with filename with file path "C:\person\microsoft\ygkyg\mmddyy\filename.xls" "\server-41\performance\mmddyy\filename.doc" ..... etc. In column B I just want to get the parent folder path. Could someone help me with the formula? I tried this but it's giving me the file name. =MID(a1,FIND(CHAR(1), SUBSTITUTE(a1,"\",CHAR(1),LEN(a1)-LEN(SUBSTITUTE(a1,"\",""))))+1,LEN(a1)) This works. =MID(A1,1,LEN(A1)-LEN(MID(A1,FIND(CHAR(1),SUBSTITUTE(A1,"\",CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))))+1,LEN(A1)))) The above was my original answer. Neil simplified the expression

Excel Reference To Current Cell

僤鯓⒐⒋嵵緔 提交于 2019-11-27 06:29:06
How do I obtain a reference to the current cell? For example, if I want to display the width of column A, I could use the following: =CELL("width", A2) However, I want the formula to be something like this: =CELL("width", THIS_CELL) Rick Teachey Create a named formula called THIS_CELL In the current worksheet, select cell A1 (this is important!) Open Name Manager (Ctl+F3) Click New... Enter "THIS_CELL" (or just "THIS", which is my preference) into Name: Enter the following formula into Refers to: =!A1 NOTE: Be sure cell A1 is selected . This formula is relative to the ActiveCell. Under Scope:

How to preserve a formula's reference to a worksheet when the worksheet is deleted and replaced?

眉间皱痕 提交于 2019-11-27 05:53:26
问题 I am the author of an application that before opening an Excel workbook, deletes and recreates some worksheets, like, for example "Sheet1" in the example below. Other worksheets (say Sheet2) in the same workbook may have formulas that refer to the replaced worksheet, like this: =IF('Sheet1'!A9="","",'Sheet1'!A9) Unfortunately, the reference in the above formula to Sheet1 is broken when the sheet is replaced, becoming =IF(#Ref!A9="","",#REF!A9) Can anyone think of a way to code this formula so

Fill non-contiguous blank cells with the value from the cell above the first blank

帅比萌擦擦* 提交于 2019-11-27 05:19:53
I have a column like the following: 1 red 2 blue 3 red 4 5 blue 6 7 8 white The blanks refer to the record above it. So #4 would be associated with red and 6 and 7 would be blue. Is there an easy way to fill in the blanks for entire column? Select A1:A8 . Press F5 to show the Goto dialog. Click Special ..... Select Blanks and click OK. That will select a noncontiguous range of blank cells. Then, without selecting anything else, type =A3 and press control + enter . That will enter an array formula in all the blank cells referring to the cell above it. Reselect A1:A8 , and Edit - Copy . Then

IF statement: how to leave cell blank if condition is false (“” does not work)

纵饮孤独 提交于 2019-11-27 05:15:50
问题 I would like to write an IF statement, where the cell is left blank if the condition is FALSE. Note that, if the following formula is entered in C1 ( for which the condition is false ) for example: =IF(A1=1,B1,"") and if C1 is tested for being blank or not using =ISBLANK(C1) , this would return FALSE , even if C1 seems to be blank. This means that the =IF(A1=1,B1,"") formula does not technically leave the cells blank if the condition is not met. Any thoughts as to a way of achieving that?