Formula / Code To Find And Sum Data
Dec 10, 2013
In the attached sample sheet, Col B has data that will more often than not be duplicated. Each Line will have a corresponding value in Col L.
What I need to be able to do is this:
Starting from row 2 (important) is find duplicates and then place the corresponding figures for each from Col L as a Sum into Col N.
So '45678' appears twice in Col B and the Sum of the figures in Col L for '45678' is 1, so 1 will now show in Cell N2.
'55685' appears only once in Col B so it will have the "Sum" of 12 in Cell N3.
'99954' appears 3 times in Col B and has a sum of 9 from the Col L values so that will be displayed in Cell N4 and so on.
Hammer Sample #2.xlsx‎
View 2 Replies
ADVERTISEMENT
Jan 25, 2007
Code such as the one below carries formulas in columns 3 and 10 down to new rows when inserted. However, I need to allow a user to overwrite the formula in col 3 with any text value. But if the user overwrites the formula on the last row, and then manually enters a new record below, then the code in the last row of col 3 does not get copied down. Is there a way to search upward in columns 3 and 10 until reaching the last cells with formulas, and apply the formulas to the new cells in cols 3 and 10 on the new row? Or, is there a way to store the formulas:
=IF(A21<>"",B21,"") in column 3
=IF(B21<>0,IF(C21<>B21,A21&", "&LEFT(C21,2),A21&", "&LEFT(B21,1)),"") in column 10
Storing these somehow would be good if the user overwrites the formulas in the very top row of data (row 2).
If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub
On Error Goto CleanUp:
With Target
If .Value <> "" Then
Application.EnableEvents = False
.Offset(0, 3).FormulaR1C1 = "=RC[-1]=R2C3"
.Offset(0, 10).FormulaR1C1 = "=RC[-1]=R2C10"
End If
End With
CleanUp:
Application.EnableEvents = True
View 3 Replies
View Related
Feb 26, 2014
I basically have a sheet where clicking a button on a UserForm creates an email and populates it with data from a specified sheet. So for example, the attachment v3.1, I've included looks at Sheet1 and populates an email with the data. However, I want it to drag data from another sheet. So, as per the attachment v3.2, I want the UserForm on Sheet1 and the data on Sheet2.
It works fine if the UserForm and data it's looking for are on the same page, but it won't find information from another sheet when the code is changed? I thought changing the code to Sheet2 instead of Sheet1 would work fine, but that's not the case!
View 7 Replies
View Related
Apr 1, 2014
I've been trying to modify the following code to find the value "Module Index" in column A. I then need the code to save the row number that the value was found in and copy a range from ("A2:V row number")
I keep getting an "object required" error on the following code line
Set intFindrow = wbTargetBook.Sheets(strName).Range("A:A").Find(What:="Module Index", LookIn:=xlValues)
[Code] .....
View 2 Replies
View Related
Dec 26, 2013
I have a spreadsheet where a date is entered in column A with data in B-F. I am trying to write code to look in column A for a specific date and enter additional data into columns G-L on the same row. It needs to be able to skip the rows that are blank. So I have the dates of 12/1, 12/2 and 12/3 in column A rows 1,2 and 3 and I want to enter data for 12/2 on row 2 skipping the blank cells in row 1 for 12/1. Here is the code I have below.
VB:
Private Sub CBSecure_Click()
Dim my_name As String
Dim r As Variant
Dim l As Long
sFind = DockDoorCal.Value
If Trim(sFind) = "" Then Exit Sub
[Code]....
View 4 Replies
View Related
Jun 21, 2014
I want to enter a unique ID into an input box which will tell which row that id is available and then it will again ask me which column the cell needs to be highlighted. Once i enter the data, it will then ask me what is the change in data (again via input box). i can then enter the change data and then it stops.
View 1 Replies
View Related
Sep 4, 2012
How to create a code formula to calculate the arc length from a given chord length?
If you know the radius of the major circle.
Say the chord is 50mm and major circle dia is 72mm (radius 36mm)
arc from chord.jpg
View 5 Replies
View Related
Jan 25, 2012
I was trying to figure how to write a formula that would return the contents of a cell in a table.
Here is the situation....
I have a 10 row by 10 column "grid". the top and left side of the grid contains a random number from 0 to 9. The numbers do not repeat.
It would remind you of a block pool.
If I have two numbers, 0 to 9 , is there a way to return the cell that corresponds to the intersection of those numbers in my table?
It would be both a Vlookup and an Hlookup which I can't do.
View 4 Replies
View Related
Sep 16, 2009
I have one workbook (workbook A) with data in it (the data is never in the same place i.e. same cells) and one I want to send data to (workbook B)
In workbook A the data is displayed as follows:.....
View 9 Replies
View Related
Feb 17, 2007
I need help creating a formula to find data in one column that starts with different letters and counts them up.
For example one column would contain the words amoung others:
DPDE
DNPD
EPRO
EOTH
YBRC
YUND
In the other column I want to count up the amount of times a word starts with the letter D or E or Y. The count comes from another spreadsheet, which the CMRF Tool (See attachment) is pasted at the bottom of.
The Monthly case report file is the file I want to get the count from. These would come from Column O once the data is there. The count would end up in column D of the CMRF tool which is pasted at the bottom of the monthly case report file.
View 9 Replies
View Related
Jul 16, 2014
I get some tables from SQL server but I like to add formula when the data transferred to Excel sheet
"Colum C" has date data from the SQL table
I have the below formula which I like to add into SQL code which can automatically work out the aged period on "Colum D" which is named as "Aged".
=VLOOKUP(TODAY()-C2,{0,"Current";31,"31-60";61,"61-90";91,"91-120";121,"121-150";151,"151-180";181,"181-210";211,"211+"},2,1)
View 8 Replies
View Related
Apr 3, 2014
I have VBA code the extracts data from a source and puts it into excel. I need to change the format of some of the extracted data so i can use it for a VLookup formula. Reference the attached example. Columns A AND B have the extraced data which are dates. In Columns C and D or E and F I have typed what I would like the data to look like so I can use in a Vloolup formula. Is there VBA or a formula that word change the format of the dates in Columns A and B to look like C and D or E and F. The changed format could be moved to any new cells or rows.
View 1 Replies
View Related
Mar 4, 2014
I created the following macro (using the recorder), and now need to modify it so that the formula extends to the end of the data (and no further). I would also like to include a total at the end.
Sub ExcessUsage2()
' ExcessUsage2 Macro
Rows("39:250").Select
With Selection.Font
.Size = 8
.Strikethrough = False
[Code0 ....
View 8 Replies
View Related
May 20, 2014
automate a data table I set up in excel. I need the formula to look through a bunch of raw data I have, and add quantities in each row, but only from the rows that have the same machine numbers. I attached the document of raw data I've collected, and on a separate tab, an organized table. I would like this table to automatically be updated with the appropriate data, as I enter it as raw data.
View 3 Replies
View Related
Jul 20, 2007
I am very green with Excel. Can anybody tell me what 'data sheet' means and where to find it? =If('data Sheet'!$G$11=1,'data Sheet'!$Bi$197,'data Sheet'!$Bj$197)
View 5 Replies
View Related
Jul 28, 2009
I received assistance from NBVC for combining data from two cells. Post http://www.excelforum.com/showthread.php?p=2135144. I need to convert the formula into macro code. I thought I would be able to convert it on my own, but running into some troubles with run time errors. Here is the Excel formula, which is working fine.
View 5 Replies
View Related
Oct 26, 2009
I have a spreadsheet with multiple columns. (Sheet1) The heading row is my customer name. (Sheet1) My column are the dates. On another spreadsheet, I would like to find the customer in Sheet2 in Sheet1, then do an index to find the relevant data I need, returned in Sheet2.
Sheet2: find customer "ABC" in Sheet1, if found, then find the date that also matches Sheet1 and Sheet2, and return data "apple" .
sheet1
DATE ABC DEF
2007-04-01 £55.60 £61.13
2007-04-02 £56.33 £60.27
2007-04-03 £52.14 £62.58
2007-04-04 £51.69 £61.28
sheet2
CUSTOMER DATE RATE
DEF 2007-04-04 This should be £61.28
ABC 2007-04-02 This should be £56.33
View 3 Replies
View Related
Jul 7, 2014
Sheet 1
Sheet 2
UPC
Sku
[Code].....
I would like to find the value from Sheet2 Column1 in sheet1 Column1 and return value from Sheet1 Column2 and Column3 into Sheet2 Column2 and Column3
And if it doesn't find anything just return Not Found
The problem that a Vlookup is not working for me is because I want it to be the exact text from sheet2 column1 but in sheet1 column 1 it should not be exact as it might have some extra text as seen in the illustration above
View 3 Replies
View Related
Oct 9, 2006
I'm using the below VBA
Dim c, DataRow
With Data
Set c = . Range("A5:A350"). Find(KPI, LookIn:=xlValues)
If Not c Is Nothing Then
DataRow = c.Row
End If
End With
Now,If KPI is for example = "Favourite Hotel" and if i have data that looks like :
Favourite Hotel - London
Favourite Hotel - Cardiff
Favourite Hotel
Favourite Hotel - Birmingham
Then it seems to not look be looking for an exact match (e.g. Favourite Hotel) and rather is finding the first item in the list that contains the KPI string (E.g. Favourite Hotel - London).
How do i make it search for an exact match?
View 4 Replies
View Related
Aug 5, 2009
DSee the attached.
The current spreadsheets add up each persons totals by matching the name in each tab with the name of the person who won the job located in current orders tab.
BUT.....If two salesman pair up on up on a job then the formula doesn't recognise the joint name. eg Gary/paul in row 69 (current orders).
I need the totals to half the job and add it to the salesmans total accordingly. There is no 'Paul Tab' as he is our MD and doesnt have a target.
View 5 Replies
View Related
Aug 12, 2004
When you're in Excel and go to "Edit" - " Find", there's an option to "Find All" and it pops up a list of all of the cells your search string is in.
Is there an easy way to do this same thing using VBA code?
I tried recording a macro, but the code was just blank.
I know it can be done one by one using a loop, but I was wondering if there was any way to just return the whole list at once?
View 9 Replies
View Related
Jan 2, 2009
I have an excel book where there is a button on the first sheet. I can't seem to find any code for it. How do i locate code for the button?
View 4 Replies
View Related
Mar 26, 2007
I’m looking for a code that finds all duplicate words in column A & B and change the font of the found duplicate word in column B to ColorIndex = 11 and .FontStyle = “Bold”
I need this code to run frequently and possibly we can combine it with http://www.mrexcel.com/board2/viewto...272792#1272792
The wb is a dictionary and as I’m adding new words in new rows the wb needs to update. It is of course mostly important it updates when I open the wb, but it would be interesting if it could update for every new row (word) added as I might not want to close and re-open the wb just for this.
View 9 Replies
View Related
Jan 15, 2009
i need a macro that will look in column B and find the following rec codes, if found then keep these codes else delete (Entire row) for all other rec codes in this column,
"BROWN", "CHASE", "CITIAMP", "CITICUST"
View 9 Replies
View Related
Feb 25, 2009
I have a workbook with several sheets that get info from sheet"Main BOM". I use a =Main BOM(a6) type formula on the top row of other sheets where info is needed and I drag that down to the end of info on the Main BOM to get the info into other shhets of the workbook.
How would I alter this code to find the last row of data on the Main BOM tab and only drag down that far? Or would I need a completly user written macro? This is a recorded macro.
Sub DragDown()
'
' DragDown Macro
' Macro recorded 2/25/2009 by David D
'
Sheets("David,Jimmy--To Proto").Select
Range("A16:E16").Select
Selection.AutoFill Destination:=Range("A16:E47"), Type:=xlFillDefault
Range("A16:E47").Select
End Sub
View 9 Replies
View Related
Jul 14, 2006
Have a cmd button and text box. I need to enter a word in the text box, hit the button, and have excel show me where that text is at on the worksheets (numerous sheets). I have tried unsuccessfully suggestions, but all want to replace the text with something. I do not need to replace the text, just find it.
View 2 Replies
View Related
Jul 22, 2007
I am writing a vba code in which the user can change their old password with the new password. For Eg- User A has password B. He wants to change his password to C, so everytime he logs in with new password, he is able to enter into the file. However, i have no idea what exactly i could do(i mean the codes in vba).
View 2 Replies
View Related
Dec 26, 2009
The first 7 digit number is the input to a certain equation. This equation outputs the 7 digit number after the space.
Input (7146127) ==> Equation ( Unknown) ==>Output (2871082)
These are some data that I have ( inputs and outputs). I was wondering if there is anyway to find this equation. I can get more data if that helps in finding the equation.
71461272871082
53820056426572
61070709150530
75833373805331
55466908456008
49264716615511
12387558353260
20013928484175
67975657084961
38006283229553
68973249414920
65179634653276
66971872613128
59646203411273
69785611400836
58284602307740
64723009925464
57930863495088
58816593932906
62736335606616
52119154778580
60043359437317
61921553996320
51507747216899
13197956063818
64210347411256
65399671193442
55656585589500
55148886441637
30850639587521
69081133766387
54139417804940
53408393698534
62310293191095
30512556590168
14514168265124
89078208134056
85177364363577
68714858216023
17584065849687
52691521917548
9840524785846
59268687494601
89374963791119
45989738961270
65040033345415
15061518946940
55392084949214
45103824265242
84181944909073
View 9 Replies
View Related
Nov 20, 2013
I have a table that looks like this:
ID
HostLocation
NDaysinHost
marina.silva
USA
100
[Code]....
I would like to obtain a table in the following format where I can find
ID HostLocation NDaysinHost
marina.silva USA, Norway, Bolivia, Italy, Ecuador... 100,45,67,8,9...
tatiana.gottig Venezuela, Chile, Peru, Canada 89,54,32,6
Searching in the net I found the following code:
VB:
Sub groupConcat()Dim dc As Object
Dim inputArray As Variant
Dim i As Integer
Set dc = CreateObject("Scripting.Dictionary")
inputArray = WorksheetFunction.Transpose(Sheets(1).Range("A2:C9").Value)
[Code]....
However I only obtain the first two columns concatenated. It says that for more columns repeat the loop, however I did and the result was not the expected, it returned me the same two columns again concatenated. How can I arrange this to fit my criteria?
View 1 Replies
View Related
Jul 20, 2009
I am using the Vlookup function to find a particular code in one sheet then give me the cost data that is associated with that code and put it into a similar cell in another sheet. It will work fine if I use (for example) A2 to E39 as my table_array. This would be fine if I only had 38 rows of data to look for the code on. However I have thousands of rows of data that need to be checked. Therefore when I change the table array to anything greater than E40, the vlookup will not work and it will only return a value of zero instead of the actual cost data. This is very weird and does not make sense that anything is wrong.
The only thing I can think of is that the vlookup function has a limit on the number of rows that it can look for data in. However, I did not think that it had a limit at all.
View 7 Replies
View Related