Compare Data-set With List & Summarize Matches
Jul 16, 2009
1) Background Info
We are trying to summarise some data that has been exported from an ancient database into a poorly delimited csv file. My colleague has imported the csv file into Excel ( attached), and we are trying to work out what to do next.
The dataset contains approx 300 records - each record being called a "sample" and having a unique sample number. NB: I have had to attach a cut-down version with only 3 samples, due to file-size - but it will hopefully give an idea.
Each sample contains 2 types of information that we are interested in (and a lot of irrelevant data besides). The relevant bits are:
- predicted occurrence of various species (given as a percentage for each species)
- observed occurrence of various species (given as positive/negative for each species, where positive is indicated by an asterisk)
2) What We're Trying To Do
We are trying to compare this dataset with a master-list of 80 species names. For each species on the master-list, we want to:
a) check whether it has a "predicted occurrence" value in each of the 300 samples (and if so, record the value in a summary sheet)
b) check whether it was observed in each of the 300 samples (and if so, record this in the summary sheet)
3) The Problem
Unfortunately, the dataset has imported into Excel as a gigantic list: 48000 rows (including loads of blanks) and only 3 columns across. To find the relevant data, it's necessary to:
a) open the attached workbook, and go to the worksheet named "Data"
b) Scroll through the rows, looking for the string "RIVPA" in column A. This tells you where each new sample begins. (The sampleID is stored in the same row as this, in column C. It is mixed up with a load of text, which we will need to separate out at some point, but that's a secondary consideration at the moment.)
c) Scroll down further until you find the text string "Predi" in column A. This indicates the beginning of the data we're interested in, for each sample (i.e. for sample 1, I'm talking about row 58). Count down a further 2 blank rows, and then you find the data itself:
- Column A contains the observed occurrence (a positive result is indicated by an asterisk)
- Column B contains the predicted occurrence
- Column C contains the species name
My colleague was trying to build a summary table, in the worksheet named "Summary". He was using the LOOKUP function to extract the data, but because there are so many samples, it's beyond unwieldy. He asked me if I could write a macro do do the job, and this is where I'm stuck.
How could I set up a macro that can identify where one sample starts and finishes, and where the data is within each sample? What is the most sensible shape for such a macro? If I could get the overarching logic worked out, I could make a start on writing the individual bits of code, but at present I just can't figure out how to begin.
To make things more difficult, the samples are not all the same length, and do not all contain the same list of species as each other. (However, at least there should be no species in the samples that are not in the master-list). The first sample begins on row 5, the second sample begins on row 173, the third on row 340, and so on.
View 8 Replies
ADVERTISEMENT
Jun 30, 2006
I have two questions:
a. Check the code below:
Dim news1 As String, news2 As String
news1 = "new"
news2 = "polygon"
Dim countie As Integer
For buddie = 2 To b1.UsedRange.Rows.Count
'If b1. Cells(buddie, 1).Value Like "new*polygon" Then
If b1.Cells(buddie, 1).Value Like news1*news2 Then
countie = countie + 1
n1.Cells(buddie, 10).Value = "test"
End If
Next buddie
I have 2 strings, news1 and news2, i need to use the like function to check the occurance of these two strings in all the cells, and just for testing purpose, im printing 'test' it out in another excel sheet.
How do i make that work? the commented line shows what exactly i want, only that i dont want to hard code the string values.
b. If i have a value in the cell:
/new/blahblah/anycra/polygon
how do i split it so as to assign two variables to have 'new' and 'polygon'.
View 9 Replies
View Related
Aug 13, 2008
I have two excel sheets, one loads up in Listbox1 and the other in Listbox2, i would like to be able to see if any entries in listbox2 match with entries in listbox1 and then to display the matches in listbox3 with a click of a command button. Is this possible? If so, how would i go about it?
View 3 Replies
View Related
Jan 28, 2008
Here is the scenario. I am running a business and each day I download my orders for the day. The information includes customer names and addresses. The customer name is for example in column E. We will call this "Book1".
I have a second workbook that I use to store bad customer information. i.e. customers that I do not wish to sell to. The information stored here is customer name and address e.g. column A - customer name, column B - 1st line of address etc. This will be "Book2".
I wish to programmatically be able to compare customer names in column E Book1 to the customer names stored in column A Book2. Any matches found should highlight the rows (i.e. orders) in Book1.
I have tried to make this clear as possible. I want to be able to do this as a macro hence programmatically so when I click a button this comparison/highlighting takes place.
View 4 Replies
View Related
Jan 28, 2008
I am running a business and each day I download my orders for the day. The information includes customer names and addresses. The customer name is for example in column E. We will call this "Book1". I have a second workbook that I use to store bad customer information. i.e. customers that I do not wish to sell to. The information stored here is customer name and address e.g. column A - customer name, column B - 1st line of address etc. This will be "Book2".
I wish to programatically be able to compare customer names in column E Book1 to the customer names stored in column A Book2. Any matches found should highlight the rows (i.e. orders) in Book1. I have tried to make this clear as possible. I want to be able to do this as a macro hence programtically so when I click a button this comparision/highlighting takes place.
View 2 Replies
View Related
Aug 21, 2007
I have included some example data and what I need to be able to show in the attached file.
I have tried using pivot tables but need to keep the totals static when I hide a column.
Can anybody suggest another way of achieving what I need? I need the solution to be dynamic (like a pivot table) but need to hide certain data and have totals including the hidden data.
View 14 Replies
View Related
Jun 27, 2014
I have two sets of data from columns A:N (O is blank) & P:AC. Column A & P are account numbers. I want to compare columns A & P for exact matches, there will never be any duplicates in either of these columns by themselves. If there is a match I would like that entire row to align, if there is no match I would like a row to be inserted. I have attached a copy of a worksheet of what I am looking to have done.
View 2 Replies
View Related
Jan 28, 2009
is it possible to have a cell return all matches from a list and have the list of matches reduce as you type, then be able to select one item from the list? this is a typical feature on internet sites, but can it be done in Excel?
View 3 Replies
View Related
Jul 17, 2012
I have Columns A and Column B. I want to find a way to choose two items from Column A. Ex Coats and Shoes and return the values from Column B,but only if they match.
it would look something like this:
Criteria 1 Criteria 2 Results
Shoes Coats New York
Texas
Column A Column B
Coats New York
Coats Texas
Shoes Washington
Shoes New York
Coats California
Shoes Ohio
Shoes Texas
Coats Texas
the Results would be dynamic, meaning there is no gaps in the results,I am only interested in the a concise list that summarizes.
View 8 Replies
View Related
Jan 29, 2010
In my spreadsheet, on the first worksheet called "Working". Column A, called "Results", contains carrot ^ delineated string values in each cell (i.e."john^apple^pear^banana^grape^love^heart^pickle"). The majority of string values in every cell in my "Results" column match a "source" column of Pick-List Values, called "Fruits" in the same spreadsheet, however found in a different worksheet called "Lists" (also in Column A). I want to perform 3 functions against my "Results" Column on worksheet "Working":
1.) Report In Column B: Analyze column "Results" by cell and return carrot delineated string values for only those that match my "Fruits" Pick-List
2.) Report In Column C: Analyze column "Results" by cell and return carrot delineated string values for only those do not match my "Fruits" Pick-List
3.) Report In Column D: Identify and return all unique values in "Column C" as a List.
Attached is a simple example of what I'm trying to accomplish called " Sorting.xls"
View 4 Replies
View Related
Feb 16, 2008
2 worksheets,
Sheet 1 columns A&B are the same as sheet 2 A&B.
Sheet 1 is my master list (customer name = column A and carrier name = column B)
Sheet 2 (customer name = column A and carrier name = column B)
Sheet 2 is where data gets dumped so I need to change font to bold when I click a check box on sheet 1 (master list) on Column C
Check box is on column C and column C will have more then one check box.
When I click check box on C I need date to populate on column D
(But when I re-open my workbook I don't want dates to change on me using the system date)
My objective is to select customer carriers on my master list sheet 1 and update date and change font to bold on sheet 2 so I can avoid or skip that customer carrier.
Hope this is not too much for my first post.
View 3 Replies
View Related
Aug 7, 2008
I want to compare cell a to range c and extract comparing cell b to cell D. I might have explained it back words but see attached.
View 2 Replies
View Related
Aug 13, 2009
I've been searching for a method to compare two large columns of numbers and remove replicates from the "main" column. Column A has all the numbers that are in column B and many more. I want to remove all the numbers from column A that are in column B. The result being two columns with no matching numbers. (or a third column that has only the numbers from 'A' that are not in 'B').
My search results on this forum have found results that compare rows for matches & can make deletions; and also one method that could mark all the entries that were duplicates in both columns, but nothing to remove them. The datasets I am using have over 400k entries in some columns, so manual removal of marked ones is not feasible. I need an automatic deletion method.
View 2 Replies
View Related
Nov 4, 2013
I have a Workbook containing four different Worksheets, each of which contains a different number of columns:
"Set A" = 18 Columns
"Set B" = 47 Columns
"Set C" = 47 Columns
"Set D" = 11 Columns
Each Worksheet contains a different number of rows, approx 4,000.
Column A for each of the above Worksheets is, however, the same and contains an alphanumeric string called "Accession ID".
I have been tasked with extracting the entire row of data for each "Accession ID" which appears on at least 2 Worksheets, and then compile them in a new "Summary" Worksheet.
So, for example, if one of the Accession IDs was "ABC123" and it appeared on all four of the Worksheets; the Summary Worksheet would contain the 18 Columns from the row on which "ABC123" appeared in "Set A", the 47 Columns from the row on which "ABC123" appeared in "Set B", the 47 Columns from "Set C" and the 11 from "Set D" all on different rows.
I tried toying with VLOOKUPs etc, but given there are four Worksheets, and in order to qualify the Accession ID must only appear on a minimum of two Worksheets - it quickly become a mess.
Is there any way of being able to do this as a macro perhaps?
View 2 Replies
View Related
Jul 3, 2007
I want to compare two columns (from two different files, but copied into a new sheet) for duplicates or identical entries. But here's the trick, each entry contains atleast a number of digits. I'm not quite sure how to find items that may be 80% identical (in the right order, but might be messing a digit, or there is a dash or a 'o' instead of a '0'). I know how to do it in C++ or Java, but not quite sure how to do it in VBA/macro. Here's an example of what I meant. Let's say column one has the following:
0244-34
9393-O0
3932-44
and second column has
939300
493384
938923
If I was comparing second column to first column, it can pick up the 9393-O0 one because it's close enough to 939300.
View 7 Replies
View Related
Oct 24, 2007
I know there is a forumla to compare a small database to a list, but can't find it (I used to use French Excel).
Here is an example :
In a sheet, my small database :
(in two different cells)
Value1 and ValueA
Value2 and ValueB
Value3 and ValueC
etc...
In another sheet, my list :
I have a list where there's a lot of Value1, Value2... in one column, and in the next column, a lot of ValueA, ValueB....
I want to check in my list : if I have Value1, then, on the same row (next column) I have ValueA, if I have Value2, then, I should have in the same row (next column) ValueB....
And if I have Value1 and in the same row (next colum) ValueB, I want some kind of "Error" text.
Can't find this function nor (of course) the criteria to use it correctly.
View 3 Replies
View Related
Dec 17, 2007
I am trying to compare two sets of data in two different columns. But I only want an approximate match. That is: Data from one given cell, has to be matched to another given cell and if an APPROXIMATE match is found, return a 1, otherwise a 0. And that should happen all the way down in the two columns.
View 2 Replies
View Related
Aug 12, 2008
I have two columns, one with the target text (D:D) and one with text I want to compare it too (A:A). If the text in column (D:D) matches the one in (A:A), I want to return the value in (B:B). I attached a sample of the problem i'm dealing with.
View 5 Replies
View Related
Sep 10, 2009
I have two sheets with pretty much the same content but not exactely. I need to compare the data from the first sheet to the data in the second sheet in this way:
data from column b (numbers) in the first sheet needs to be compared to data in column b in the second sheet. if this dosen't match it needs to go to the next line.
if the match is positive it needs to compare the data from column d on the first sheet to the data on the second sheet same column and copy the data from the first sheet's column d to the second sheet's column d. But only if the data in column d on the first sheet isn't blank. If it is it should leave the data on column d second sheet intact.
View 4 Replies
View Related
Dec 2, 2007
I am trying to compare mutiple columns of data, match them and copy select data. Find matching cells in 2 different columns and copy select info into that row. See file attached
View 7 Replies
View Related
Dec 23, 2007
I have a workbook with two sheets imported from different sources. Sheet 1 is an AdHoc query from an Oracle 10g based program. Sheet 2 (PBIC 8 in my file) is a report generated from a property accountability program. The information from Sheet 2 is manually inputted into the Oracle program that generated Sheet 1.
I would like to have a macro that would compare the cell contents in columns "RegistrationNbr" (column S) and "SerialNbr" (column T) with the cell contents in Sheet 2 (PBIC 8). The match in Sheet 2 could be an identical match or part of a longer string. The matching cells in both sheets should be highlighted.
One thing to be considered is the column names in Sheet 1 will always be the same but the column letter designation may change base on the fields selected in the AdHoc query.
I didn't realize my file was too large and didn't upload.
View 4 Replies
View Related
May 20, 2008
I have two excel sheets exported from two sources of information. Both sheets contain 1 column which is the primary data, ie, there is no duplicate of that information. Each information in these column represent 1 device in the real world.
Now, for example:
In one sheet, I have: SDV0620B
In the other sheet, I have: SSDV-B0620B
Please note that, both data actually represent the same device. What I now need to make sure is that, I ccan identify each corresponding data from the two sheets.
So, here is the problem that I am facing, identifying two data which are same but has two different representation techniques. (since the data are from two different sources)
I came up with the idea that, if I can check the sequence of characters with one column to another, then I might be able to pull it off.
For example,
we take SDV0620B, and match the sequence of character with SSDV-B0620B.
therefore, first is S (from SDV0620B)
match with SSDV-B0620B
then, D
match SSDV-B0620B
then V
match SSDV-B0620B
and so on, until the end.
And if the 1st sequence is found in the second sequnce of characters, then it is called a match! Hope I have explained it clearly. I have provided a file with some of the data copy and pasted out, to give you an idea of what the values look like.
View 9 Replies
View Related
Aug 7, 2008
I have two separate workbooks, each with a great deal of information, such as name, ssn, dates, statuses, etc. I would like to compare the SSN column for both workbooks, and when it finds a match (which there would be many) to copy the MOS cell from the same row to the other workbook. Here is my breakdown with names:
Workbook 1: Macros.xls
Workbook 2: MASS 162.xls
The SSN column is column C in both workbooks
When there is a match found between the SSN column in Macros.xls and the SSN column in MASS 162.xls, I need to copy the MOS cell (column E) from the MACROS.xls workbook to the MASS 162.xls workbook into the same row, but in column M, which is currently empty.
View 7 Replies
View Related
Mar 21, 2007
I've got two worksheets ("June" & "July"). On both worksheets, column A is comprised of ID numbers and column B contains dollar amounts. I need to compare the ID numbers in Column A on each worksheet, and if they match I want to copy the ID number and the amount to a third worksheet ("Results").
View 3 Replies
View Related
Jan 19, 2008
I have this code that compares two columns on two different sheets when it finds a match it then puts the match on that sheet your running it from in my case sheet 2. However i want to change this slightly and im having a hell of a time. I want to match but when tha match happens i want it to copy the cell next to the match.
Sub Find_Matches() ...
View 3 Replies
View Related
Jan 30, 2009
I have a list of sales events that ran at various venues, together with how many people attended and how much revenue was brought in by sales. This data is arranged by week. One venue will never have more than one event per week, but different venues may have sales events on the same week.
My table looks like:
In reality this list could be thousands of rows long.
“Event week” is the calendar week of the event. “Weeks open” shows for each event how many weeks that venue has been open (may or may not be useful!).
What I need to do is to be able to pick a number of weeks (preferably changeable by entering into a cell) and have a list produced of each venue that has run for at least that many weeks, and the sum of people and sales in those first X weeks. My idea of output, if the user input “2” as the number of weeks would therefore look something like:
Note that
1)only venues that have run at least 2 meetings are shown in the output
2)even if venue has run over 2 meetings, only people and sales figures from the first 2 are summed up and displayed.
In this case. Later on I need to produce a frequency chart/histogram grouping the results into categories, but I know how to do this as long as I can get to the step before – but wanted to mention it in case there are shortcuts.
Have been battling with this with pivots, database functions, array formulae etc. for a long time.
Attached is the spreadsheet with sample data. The red table is the part I am stuck on. The solution has to work in Excel 2003.
View 4 Replies
View Related
Mar 13, 2007
I have data in 2 workbooks. Book1 - Sheet1 - Col A and Book2 - Sheet2 - Col A. I want to compare Book2 with Book1 and list all values in Book2 that do not find a match in Book1. I want to run a macro for this
View 7 Replies
View Related
Apr 26, 2014
Sheet1 is Main Sheet which never will be amended and these numbers will be a source for pulling mathematical functions
See attached :
Sheet1.png
Don't be bothered about cell colors etc. They are for my reference
Sheet2
Will contain same Problem Ticket numbers but different (or same) values with number of 'Linked Incidents'
See screenshot
Sheet2.png
Based on Problem ID 10248
Main sheet shows 92 Linked Incidents
Value on Sheet two brings 93
If A5 Sheet2 value can be found in ColumnA Sheet1, look for a number in ColumnC, same ROW and compare it to C7 in Sheet2 ?
Bring up difference value, which in this case would be one.
View 1 Replies
View Related
Dec 15, 2011
I got 2 sheets. (1 called "Revenue", the other "101") in the sheet revenue are department codes (variable 100 to 999) they are situated in row "B". the corresponding data in row "D".
this data needs to be transported to the sheet "101"
in the sheet "101" are put the numbers 100 to 999 in row "A"
in row "B" we need the data from the revenue sheet that is corresponding with the department code.
View 1 Replies
View Related
Jan 23, 2006
I am trying to compare multiple column in a worksheet to find
common component in all the columns and what is unique to a particular
column only. And list the results/finding in adj column. What i am
trying to accomplish is something as below.
BEFORE
Sheet1 Sheet2 Sheet3
Column2 Column2 Column2
02-1234-12 07-1234-12 02-1234-12
04-1234-12 03-1234-12 02-1234-12
05-1234-12 02-1234-12 06-1234-34
AFTER
Common to all Unique to sheet1 Unique to Sheet2
02-1234-12 05-1234-12 07-1234-12
View 14 Replies
View Related