formula

macros vba need to apply formula to column till it has value in the last row

你离开我真会死。 提交于 2019-12-12 22:11:09
问题 I need to apply "IF "formula in whole C column till has last value in the sheet using VBA . but i am getting error 438 if i use the following code . Plz help me Sub test11() With Sheets("Sheet") .Range("c1:c" & .Cells(.Rows.Count, "A").End(xlUp).Row).Formula = "=IF(B1="",TRIM(A1),TRIM(B1))" End With End Sub 回答1: So your sheet name is Sheet or Sheet1 ? And OP mentioned Sheet name is Sheet2 . That removes one error. Secondly, you need to set D column as .Cells(.Rows.Count,"D").End(xlUp).Row)

Google Spreadsheets - Join or Concatenate text from multiple rows that have matching values in one of the columns

不羁的心 提交于 2019-12-12 20:57:30
问题 As the title says, I need to join or concatenate text from multiple rows that have matching values in one of the columns. (Using latest Firefox, Widows 7). In Sheet1 I have a table that looks like this (sorry if it looks messy - I don't know how to do a neat table on SO): David | 1 | Blue Steve | 1 | Green James | 2 | Chris | 1 | Steve | 3 | Blue Jack | 1 | Ben | 1 | James | 1 | Jack | 2 | Yellow George | 4 | In Sheet2, I would like a table that looks like this: David |1| Blue Steve |4| Green

Insert Round function into current cell using VBA

匆匆过客 提交于 2019-12-12 12:30:12
问题 I'm trying to make it easier to insert the Round function into a number of cells that already have formulas in them. For instance, if cell A1 has the formula =b1+b2 , after the use of this macro, I want the cell contents to read =Round(b1+b2,) . The formulas in each of the cells are not the same, so the b1+b2 portion has to be anything. All I can get to is this: Sub Round() Activecell.FormulaR1C1 = "=ROUND(b1+b2,)" End Sub So I'm really looking for some way to get the formula in a selected

Random but predictable number generator? [C++]

不打扰是莪最后的温柔 提交于 2019-12-12 12:29:25
问题 Well I don't really know how to search for the thing I'm looking for. Google gives tons of results, but none which match my criteria. So I'm asking it here: Is there any known piece of code that can create a number, that is predictable, looks random, and is based on a 'seed' (in my case it's the unix timestamp) and between a specified range? I want to be able to create weather forecast in a script for a game I'm coding (but I need the C++ code which I can port, I don't think many people here

Combining cbind and paste in linear model

别说谁变了你拦得住时间么 提交于 2019-12-12 10:56:24
问题 I would like to know how can I come up with a lm formula syntax that would enable me to use paste together with cbind for multiple multivariate regression. Example In my model I have a set of variables, which corresponds to the primitive example below: data(mtcars) depVars <- paste("mpg", "disp") indepVars <- paste("qsec", "wt", "drat") Problem I would like to create a model with my depVars and indepVars . The model, typed by hand, would look like that: modExmple <- lm(formula = cbind(mpg,

how can I copy a conditional formatting in Excel 2010 to other cells, which is based on a other cells content?

喜欢而已 提交于 2019-12-12 10:42:49
问题 I need to copy a formula based conditional formatting to other cells but i have to change the formula for every single cell condition. how can I do a copy of this condition so that the formula changes accordingly as well? in cells, when copy cells with formula referring to other cells, then excel will change the referring cells accordingly. But I don't know how to do the same in conditional formatting so that I don't need to change my conditional formula manually: condition: =K21+$F22 (the

Multiple 'If' statements?

僤鯓⒐⒋嵵緔 提交于 2019-12-12 10:26:43
问题 Assume i have a function checkTime like the one below where i have to check for multiple condition simultaneously. var result=0; function checkTime(time1, time2) { if (time1 >= 0 && time2 <= 0) { result = 1; } else if (time1 >= 0 && time2 <= 1) { result = 4; } else if (time1 >= 2 && time2 <= 3) { result = 5; } else if (time1 >= 4 && time2 <= 6) { result = 6; } else if (time1 >= 7 && time2 <= 9) { result = 7; } else if (time1 >= 11 && time2 <= 12) { result = 8; } else if (time1 >= 13 && time2

What is the Google Spreadsheet syntax for the HYPERLINK formula to reference another cell that contains a hyperlink rather than a straight url string?

梦想的初衷 提交于 2019-12-12 09:10:37
问题 The hyperlink formula works nicely here - the effect is to hyperlink nicely from the image in the cell =HYPERLINK( "http://www.google.com" ; IMAGE( "http://www.google.com/intl/en_com/images/srpr/logo3w.png" ) ) But what if we wanted to reference the hyperlink directly from another cell? =HYPERLINK( "A2" ; IMAGE( "http://www.google.com/intl/en_com/images/srpr/logo3w.png" ) ) I can't quite seem to crack this little baby ;-) Would provide users with the knowledge and ability to represent

Pass formula to function in R?

我的梦境 提交于 2019-12-12 08:33:09
问题 Any help with this would be really appreciated. I am using the Lumley survey package and am trying to simplify my code, but have hit a slight snag. The svymean function from the package is called as follows in my code, where the first argument is a formula indicating which variables I want, and the second argument is that dataset: svymean(~hq_ehla, FraSvy, na.rm=TRUE) I'm trying to create a function that will pull out the mean (proportions) and standard errors for categorical variables, so I

Excel Why is my IF-formula not working?

佐手、 提交于 2019-12-12 07:03:55
问题 I have this formula: =IF(testing!I:I=A6;testing!A:A;"wrong") I want to control with the formula whether the mapping of values is right. I want to know whether the value in A6 has more corresponding values in the column A in the 'testing'-sheet. So when A6 appears in the column I, I either want to know which corresponding value it has in column A, OR if he has MORE THAN ONE, I want to get 'wrong' as an answer. 回答1: I think that is because if you simplify the test to just =I:I=A6 that will