formula

Excel VBA Trying to write a “MAX” formula to Cells with different Ranges with For-Loop

可紊 提交于 2019-12-13 08:38:04
问题 I am trying to make VBA write a formula into different cells that will find the maximum value for a Range decided by some variables. My variables I and J are (numbers/Integers). Here is my code. Sub AddMAX() Dim I As Integer Dim J As Integer Dim L As Integer I = InputBox("Number of columns to check max value") J = InputBox("Number of Rows to add formula inn and find max value of that row") For L = 5 To 4 + J Worksheets(1).Cells(L, 4 + I).Formula = "=" & Max(Range(Cells(L, 4), Cells(L, 3 + I))

finding the highest total for a consecutive group of entries in a column - EXCEL

﹥>﹥吖頭↗ 提交于 2019-12-13 08:35:15
问题 rather then finding the highest single entry, i want the highest total for a consecutive group of n entries e.g within a column of 100 values i want to look to find 10 consecutive cells whose sum is a maximum I say 10 as an example i wish to be able to change that easily. 回答1: By far the cleanest way to do this is with a User Defined Function (UDF). Here is a small routine that will do it. Place this routine in a standard code module: Function MaxN(n&, r As Range) Dim i&, j&, m#, t#, v v = r

How do I make 100 = 1? (explanation within)

南笙酒味 提交于 2019-12-13 07:59:15
问题 Right now I have a code that can find the number of combinations of a sum of a value using numbers greater than zero and less than the value. I need to alter the value in order to expand the combinations so that they include more than just the value. For example: The number 10 yields the results: [1, 2, 3, 4], [1, 2, 7], [1, 3, 6], [1, 4, 5], [1, 9], [2, 3, 5], [2, 8], [3, 7], [4, 6] But I need to expand this to including any number that collapses to 1 as well. Because in essence, I need 100

General formula for a recurrence relation?

你。 提交于 2019-12-13 07:15:12
问题 I was solving a coding question, and found out the following relation to find the number of possible arrangements: one[1] = two[1] = three[1] = 1 one[i] = two[i-1] + three[i-1] two[i] = one[i-1] + three[i-1] three[i] = one[i-1] + two[i-1] + three[i-1] I could have easily used a for loop to find out the values of the individual arrays till n , but the value of n is of the order 10^9 , and I won't be able to iterate from 1 to such a huge number. For every value of n , I need to output the value

Find start values for NLS function in R [duplicate]

僤鯓⒐⒋嵵緔 提交于 2019-12-13 05:47:33
问题 This question already has answers here : In r, get output values in power curve for 'a' and 'b' values (3 answers) Closed 5 years ago . i am trying to make a fit for a power function using the NLS function in R but i am failing to find good start values. This is part of my data "CentroM": Wg TLcm 3200 79 2650 77 2750 74 870 45 1480 52 3400 80.5 2400 76 2800 76.5 2900 77.5 2700 76 3215 76 3300 83 3100 79 3000 78.5 2800 76 2700 77 2500 74.5 2300 69 2700 73.5 3350 79 and here is the script i

Formula to calculate number of years/months/days… from long (milliseconds)

我们两清 提交于 2019-12-13 05:15:14
问题 I have a certain duration value (endDate - startDate = duration in milliseconds), i need to get the time difference in such format: 0 years 5 months 3 days ... I need the mathematical formulas that can help me extract the number of years/months/days/hours/mins/secs from that duration. I am using XSLT 1.0 and can't use any XPath2.0 date functions. so i need to write the function myself. 回答1: Going down to days is simple. tmp = time in milliseconds milliseconds = tmp mod 1000 tmp = floor(tmp /

Referencing Public Constants in Cell Formulas

早过忘川 提交于 2019-12-13 04:33:39
问题 I would like to be able reference a public constant in a cell formula. I have found multiple references to defining constants from cell values, but not for using constants in formulas. I would like to be able do something like this (I know that this is not the right syntax, but you get the idea...) ="Some formula text " & myPublicConstantName Ideas? Thank! 回答1: Your public constant lives in a standard module, and probably looks something like this: Public Const Foo As Long = 42 You can expose

Calculate interest rate in Java (TVM)

柔情痞子 提交于 2019-12-13 04:31:05
问题 I've been working on a Java project which is calculator which can be used for calculating different scenarios of compound interest (very similar to the TVM Function found on a graphics calculator like this one) The main function of the calculator is to calculate missing values using the known values in a formula. I have gotten all of the formulas working except for the one which calculates Interest rate ( I ) I have done some research and apparently there is no straight formula to calculate

how do i subtract two grandtotal fields in Crystal Reports

北城以北 提交于 2019-12-13 04:01:36
问题 I'm using crystal reports and i have created two sum grandtotal fields. Now i want to do field 1 - field 2 in a X1 formula, but i can't call those fields into the formula. So I tried to use Sum({field1}) - 2 but that doesn't seem to get the grandtotal. Is it possible to do a grandtotal in a sum like Sum({field1}.GrandTotal) ? 回答1: create a formula and write Sum({field1}-Sum({field2} and place at rigt most part that is after all columns. If this doesn't work then follow below process. Crate a

Minimum & Maximum Values in Crystal Reports 2008 Column

自古美人都是妖i 提交于 2019-12-13 03:55:22
问题 Say I have this column returned in a command for Crystal: deposit_no 123 130 125 124 126 127 128 129 and I need to have this in the report title: Includes deposits between 123 - 130 I've tried a running formula for minimum and maximum and they aren't returning the correct values no matter how I manipulate them. I've tried evaluate for every record, on change of the deposit_no field, etc. I have no grouping on this report. Edited to add: While I preferred to handle this on the CR side of