excel-formula

Splitting string to parts with specific pattern and conditions

假装没事ソ 提交于 2020-01-03 16:58:22
问题 I have the below-like array of about 5k+ strings as output from certain application (for security reasons I may not provide the exact data, but the example format is pretty much similar to the actual data): kasdfhkasdhfaskdfj42345sdsadkfdkfhasdf5345534askfhsad asdfasdf66sdafsdfsdf4560sdfasdfasdf sdfaasdfs96sadfasdf65459asdfasdf sadfasdf8asdfasdas06666654asdfasdfsd fasdjfsdjfhgasdf6456sadfasdfasdf9sdfasdfsadf Simply, I have non-breaking alphanumeric string that consists of 5 parts : [latin

How to enter a formula into a cell using VBA?

若如初见. 提交于 2020-01-03 08:14:47
问题 I am trying to enter a formula into a cell which contains variable called var1a? The code that I have is: Worksheets("EmployeeCosts").Range("B" & var1a).Formula = ""SUM(H5:H""& var1a) But it enters into an excel worksheet with a mistake. 回答1: You aren't building your formula right. Worksheets("EmployeeCosts").Range("B" & var1a).Formula = "=SUM(H5:H" & var1a & ")" This does the same as the following lines do: Dim myFormula As String myFormula = "=SUM(H5:H" myFormula = myFormula & var1a

How to enter a formula into a cell using VBA?

こ雲淡風輕ζ 提交于 2020-01-03 08:14:06
问题 I am trying to enter a formula into a cell which contains variable called var1a? The code that I have is: Worksheets("EmployeeCosts").Range("B" & var1a).Formula = ""SUM(H5:H""& var1a) But it enters into an excel worksheet with a mistake. 回答1: You aren't building your formula right. Worksheets("EmployeeCosts").Range("B" & var1a).Formula = "=SUM(H5:H" & var1a & ")" This does the same as the following lines do: Dim myFormula As String myFormula = "=SUM(H5:H" myFormula = myFormula & var1a

Count number within slabs through excels function / formula

帅比萌擦擦* 提交于 2020-01-03 05:09:10
问题 I want to count the amount between different value slabs. For Example **Customer Amount** A 100 B 300 A 500 C 700 D 900 E 1100 F 1300 G 1500 H 1700 I 1900 Desired result **Solutions Count** Between 100-500 2 Between 500-1000 3 Between 1000-1500 3 Between 1500-2000 2 i tried it trough countif formula but it include a lot of efforts when there is huge data and lots of amount slabs are included 回答1: If it can help, I have a peace of code which generates the formula for the "slabs", and calculate

Count number within slabs through excels function / formula

ぃ、小莉子 提交于 2020-01-03 05:08:07
问题 I want to count the amount between different value slabs. For Example **Customer Amount** A 100 B 300 A 500 C 700 D 900 E 1100 F 1300 G 1500 H 1700 I 1900 Desired result **Solutions Count** Between 100-500 2 Between 500-1000 3 Between 1000-1500 3 Between 1500-2000 2 i tried it trough countif formula but it include a lot of efforts when there is huge data and lots of amount slabs are included 回答1: If it can help, I have a peace of code which generates the formula for the "slabs", and calculate

Formula to search table and return multiple column headers

回眸只為那壹抹淺笑 提交于 2020-01-03 04:15:09
问题 I am trying to enter a certain value in a cell, search a table for that value (vertically and horizontally), then return the column header of the columns containing that value. My formula works, but it will only return 1 column header, and I need it to return multiple Formula: {=INDEX(Sheet2!A1:J31,,MAX(IF(Sheet2!A1:J31=B2,COLUMN(Sheet2!A1:J1)-COLUMN(Sheet2!A1)+1)))} 回答1: I'm not aware of a built in Excel formula that will do this, but this can be accomplished with a user-defined function.

Changing a Worksheet Formula to a VBA formula with worksheet.function

谁说胖子不能爱 提交于 2020-01-03 03:19:07
问题 currently I have a relatively complex workbook formula, which I would like to translate to a vba formula. Currently, I wrote the following but I want it to basically evaluate the function during code execution and insert the value into the required cell. I imagine this is some combination of worksheetfunction but I am unsure of how to translate this Code (doesnt work) MWS.Cells(LastMWSR + 1, ClastMWSC).Value = WorksheetFunction.SUMIFS(mws.range(N:N),mws.Range(B:B),worksheetfunction.INDEX(mws

Index multiple columns and Match distinct values, returning list of unique values across columns

人走茶凉 提交于 2020-01-03 02:50:10
问题 I've searched far and wide for a solution to my problem... over several long weeks now. I've come up a partially working solutions, which I'll include at the bottom for those who might know how to modify/extend them to resolve the problem. Here's what I'm trying to accomplish (the following descriptions are in reference to this screen capture http://imgur.com/oTkbjrw): 1) I am looking to match values from Column G with Column A ($G2 with $A$2:$A$10). 2) If the values match, then extract

Index/Match Time Match Errors

柔情痞子 提交于 2020-01-03 02:46:05
问题 I am using index/match to extract data by matching date/times using INDEX(D:D,MATCH(A2,B:B,0)) A:A column of date/times has been manually entered. B:B column of date/times input as B2+time(,30,) and copied down. After 3 lines the formula gives #N/A as an answer. It has something to do with the times not matching exactly even though A5=B5 gives a true result that row gives #N/A If I copy A:A to B:B i.e. all manually entered times it works perfectly. Please help. A B C D E F G H I J K AET

VBA - Value of an option button in a frame (within an Excel sheet)

我的未来我决定 提交于 2020-01-03 02:40:14
问题 I'm having problems with shapes, frames and option buttons... I'm a total newbie, I've never used them. I just put several option buttons on an Excel sheet (Using the FORM toolbox). I'm trying to check whether my optionbutton is filled or not. So far, I've done the following : Sub SX_EXTERNE() Dim Ws As Worksheet Dim ConBut As Shape Dim Answer As String Set Ws = ThisWorkbook.Sheets("Externe") For Each ConBut In Ws.Shapes If ConBut.Type = msoFormControl Then If ConBut.FormControlType =