Finding Last Row In Data Row That Matches Criteria

Oct 14, 2009

have two worksheets. sheet1 has order information on it with orders, dates, customer names. sheet2 has customer name list. How can I (via vba) search through the order sheet and find the most recent order date for each customer in the customer name list. post that most recent date next to the customer name on sheet2.

View 4 Replies


Finding Text That Matches Format Criteria In String?

Oct 3, 2011

I'm trying to restructure a list of files at work into a format that makes some sort of sense and can be filtered into useful information.

Part of what I need to do, is match up all the drawing numbers that a certain project references. The numbers are formatted like "####A##" ex. 1234A01,1234A02,5678A01, etc. The cells that I need to extract drawing numbers from contain some description or other text (not just the drawing number) so I need to extract the drawing number from that cells value. (Ex. I need to get the drawing number 1234A01 from a cell whose value is "blah blah 1234A01 blah blah blah")

I was thinking I could just search the string for "####A##" but I'm not really sure how....I tried instr, but I think its searching for the literal value of "####A##" rather than treating the # characters as wildcards...

I tried:

if rngNames.Cells(intx, 2).Value Like ("*####A##*") then
set intStart = instr(1,rngnames.Cells(intx,2).value,"####A##")
end if
but intStart remains 0, so this method is not working...

View 3 Replies View Related

Finding Matches And Adding Additional Data

Mar 17, 2014

Sheet 2 in the attached sample workbook (without all the pre-existing formula's from the original) contains data that I paste in (Cols A to D).

Sheet 1 then searches that data (minus Col D) from Sheet 2 and returns "Yes" to Col I if matching data is found.

What I would like to do now is if Sheet 1 returns "Yes" then the corresponding value from Sheet 2 would be returned to Sheet 1 Col J.

So in this example the value "5" would be returned to Sheet 1 Cell J1

I already have all the formulas in place to find the matches and return "Yes", this is just to return the additional information from Col D Sheet 2 to Sheet 1 Col J..

View 3 Replies View Related

Finding Matches Between Two Sets Of Data - Each Set Has Three Columns Of Data

Jul 13, 2013

I am working on large sets of data (more than 50,000 rows of data). I have two sets of data. Set 1 and Set 2 (master data) on the same worksheet. Both the sets of data have three columns each. I am using EXCEL 2007. I was able to accomplish step 1 below.. but I am totally lost with step 2 since i have an additional criteria for the "year".

I have attached the excel sheet as well. This is what I am trying to accomplish:

1) I want to find exact matches in set 1 and set 2 and highlight it or do something to show that a match was found. The challenge is the data in set 1 can occur anywhere in set 2.

2) Add to the complication .. my criteria for matching the year is different. If the Set 1 "year" is equal to or greater by 1 yr or greater by 2 yr when compared to Set 2 "year", I want to treat it as a "match".

For example, from the data attached:

Set 1 data in row 4 is: ATLANTIC ABSECON 2004
Set 2 data in row 3 is: ATLANTIC ABSECON 2003

I want to treat these two data as "MATCH" since ATLANTIC matches ATLANTIC, ABSECON matches ABSECON and according to one of my criteria for year, Set 1 "year" is greater by 1 yr than the Set 2 "year".

View 1 Replies View Related

Count Data That Matches Criteria In 2 Columns

Feb 20, 2007

I am trying to use a "=COUNT(IF(..." formula to count the number of hourly employees that have start dates older than 3 years. Column A has the start dates and column B has the salary status (S/H). =COUNT(IF(AND(A2:A1000<DATE(2004,1,1),B2:B1000="H"),A2:A1000)) This formula returns 1 no matter what I change the data to.

View 3 Replies View Related

Macro To Copy Data From Columns And Paste In Rows After Given Criteria Matches?

Nov 21, 2011

I have a macro that would check data in Column A and validate if a particular number is repeating, then for that number go to column B, Take the Values from there go to a new sheet and paste the values in a row.

CurrencyDateRef CodeIDAccountAmountDes.USD07152011XDVU4315210.4200.C5001.USD-18,606,772.190Distr Payable 07152011USD07152011XDVU4315210.4200.C5002.USD-111,131.450Distr Payable 07152011USD07152011XDVU4315420.4240.C5001.USD18,606,772.190Distr Payable 07152011USD07152011XDVU4315420.4240.C5002.USD111,131.450Distr Payable 07152011

I get the data in the below format

CurrencyDateRef CodeIDAccountAccountAmountDes.USD07152011XDVU4315210.4200.C5001.USD420.4240.C5001.USD-18,606,772.190Distr Payable 07152011USD07152011XDVU4315210.4200.C5002.USD420.4240.C5002.USD-111,131.450Distr Payable 07152011

I need to the macro to get the data not from the second cell.

Below is my macro

Sub test()
Dim idRange As Range, c As Range
Dim uniqueID As String
Dim destSht As Worksheet, sourceSheet As Worksheet
Dim r As Long
Dim i As Integer
Dim map As Object, key, item


View 2 Replies View Related

Finding Matches Between Two Datasets?

Aug 3, 2014

What's the best way to look at two sets of data in excel and make comparisons between them. For instance how many matches (and what are the matches). Workbook attached as an example.

matches between data.xlsx

View 8 Replies View Related

Finding Sheet That Matches A Cell Value

Jun 12, 2008

I have worked on the code – with as limited knowledge as I possess – to perhaps communicate my intention. I know for a fact that in the code below there are 2 problematic lines – and herein lies the root of my problem. The first line is: “Dim Day As String” In Debugger speak, I am told that this cannot be done along with “Set sh = Worksheets(Day.Value)”. However, in normal speak, I am trying to copy data from one sheet to another. When pasting the data on the second sheet, I am trying to make the code find the appropriate sheet that matches a Day value in Cell I5. Getting the code to execute this one action is proving to be particularly difficult. I am thankful for any suggestion on how to get the code to work correctly.

View 14 Replies View Related

Finding Exact Matches Using Vlookup

Jul 24, 2006

I am getting #N/A errors even when I have an apparently exact match in my
table array to the lookup value. I know that excel requires the formats to
be exactly the same and I can force the match if I copy the lookup value from
my table array and paste it into the worksheet. Is there an easy way to
"fix" my table array. The table array is a reference worksheet I have
created which has worked in the past.

View 13 Replies View Related

Finding Data Based On Row & Column Criteria

Jun 15, 2006

I have a main soure data which consist of row & column information. What i want to do is search the data from the source data into my result data as per the attachment file. Example: I want to information of Jan & banana from the main source file to appear in the XXXX

Result data(criteria base on Month & type)

View 4 Replies View Related

Finding Partial Matches Of Text In 2 Different Columns

Mar 18, 2014

how to find partial match of text in 2 different columns.

For example:

Column A:

Los Angeles
New York


I want to be able to create a column that finds all the matching cities from A in B.

View 9 Replies View Related

Finding Data In Column That Meets Multiple Criteria

Jun 16, 2014

Any quick way to extract data from a table. I need to extract a value from a column that meets criteria from two different columns. I thought I could get this to work with vlookup, but have had no success. Sample data below in table 1 and I would like to get my data into table 2.






[Code] ..........

View 9 Replies View Related

Multiple Criteria Matches

Mar 16, 2007

I am trying to set up a worksheet whereby two critera when matched from a drop down list will populate cell 'x' with a coressponding answer. if you have Destinations then a From and To column with various locations listed below, then in a thrid column you have an output cell which is kilometres. What formula can i use to match the various location 'to' and 'from''s with the correct kilometre match?

View 8 Replies View Related

Replace Column With Certain Criteria Matches

Apr 20, 2009

4 columns a-d. now if i find either 1 of the 2 particular strings "hello" or "bye" in column A, I want to move column b into its place and leave the rest of the columns untouched


dog, circle, blue, 123
hello, frog, green,223
pig, triangle, red, 445
bye, elephant, grey, 322


dog, circle, blue, 123
frog, blank, green, 223
pig, triangle, red, 445
elephant, blank, grey, 322

View 2 Replies View Related

Userform For Search That Matches Three Criteria?

Mar 18, 2013

I created a userform for a giant spreadsheet with tons of data in it. There are three criteria. I created two command buttons - one that's "search" and one that's "close." The close works fine, but I don't know enough to program the "search" command. I'd like it to pull all data that matches the three criteria - rows H, D and M. So, if you answer all three, the macro will pull the rows of data that matches and paste it into another workbook (that opens in another window).

I'm not sure userforms are typically used for this sort of thing...

View 9 Replies View Related

Identify Matches Between 2 Lists Using Criteria

Oct 12, 2009

the attached workbook. Am trying to write a formula in Column F, which returns the results shown in Column H. Hope the workbook clearly sets out the criteria I'm trying to apply to the Lookup.

View 2 Replies View Related

Return Row Number That Matches 2 Criteria

Feb 15, 2010

I have a produced an Excel workbook which uses a VBA sign in/out userform.
Once you sign in on the Userform the sheets update. A list is completed of the times people enter and leave.

To make the code easier I currently have the name being returned to the excel sheet and performing a “match” function to return the row number. This row number is then used to carry out what I need to happen in this row. However, as you can see from attached doc (and the brief example below), based on IDnumber "2", the match function returns row 5 not row 8.
I need to have the row number returned for the IDnumber where the Out cell is blank.
This should be the last occurrance of the IDnumber

1 ID# In Out
2 1 9:00 13:00
3 4 9:00 13:00
4 3 9:00 13:00
5 2 9:00 13:00
6 5 9:00 13:00
7 6 9:00 13:00
8 2 14:00

View 5 Replies View Related

Populating Cell Only If Multiple Criteria Matches ...

Mar 31, 2008

I have two worksheets. The first contains a list of software (some having duplicate listings) in column A and a list of comments in column B. None of the software titles that have duplicates will have comments.

The second worksheet contains a condensed list of software (the previous list without the duplicates) and a column for the comments.

I need to have a formula that populates the second worksheet comments cells with the corresponding comments from worksheet one only if:

(1) The software title in worksheet two matches the software title in worksheet one
(2) The comment cell in worksheet one contains a comment (or text)

I have had only partial success; my obstacle being the duplicate software titles in worksheet one.

View 10 Replies View Related

Two Criteria - Multipule Matches That Are The Same - 1 Answer To Be Return

Oct 16, 2008

I've been looking through past threads and I can't find what I need to do anywhere. There was one formula that came close: =SUMPRODUCT((A2:A100="Aimbry")*(B2:B100="LW")*(C2: C100)). but this adds up all the matching results.

What I need to do is match the info in columns A and B and return a number in column C. The problem is that there are multiple rows with identical entries and I just want to return one of them. So I was thinking a version of the above that produced a mode or average would give the desired result.

View 3 Replies View Related

Count If Column Heading Matches Criteria

Jul 28, 2006

I have data (coming straight out of another system, so whilst is seems messy, its the easiest way to have it in Excel).... where there are a number of rows (one for each employee) - then every column represents a date in the month (so there are about 30 columns)....the cells contain a number of hours worked by that employee for that day.

I have figured out how many hours they worked for each day of the week, but my client now wants to know:

for each employee - how many Mondays did they work?- how many Tuesdays? and so on

I am happy to figure out the day of the week for the first date in the month and then manual set up another column heading above the date that tells me what day it is - but I feel that Excel may actually be able to work out what day of the month it is - although the dates come across from the other system as text - April 26, 2006 etc...

So I would like a summary in my sheet that has column headings
Mon, Tues, Wed, Thurs, Fri, Sat, Sun
and then for each row for each employee - I would like the number of days that employee worked for the month by these Days of the Week.

I have looked at Count if - but I need to be able to select the range of cells to count, and also the range of cells to evaluate for the criteria and I cant figure it out!

View 9 Replies View Related

Multiple Matches In Array (one Or Two Criteria) And List Results

Sep 15, 2014

I have used INDEX/MATCH/ROW/SEARCH functions, in different permutations, but I am unable to get the result. The data set is something similar to the below:


I use it to go for work

[Code] .....

I want to be able to do following (2 separate tasks):

Task 1 (if in A1 on a new sheet, I had Use, i want to list all the items in an adjacent column, skipping the blank rows)):


I use it to go for work

Family trips
Weekend fun
2nd car

Task 2 (if i had Honda (A2) and North (B2), I want to have the colors listed in Column 3):




I know this can be done by an auto-filtering or manual sort, but I have work with thousands of similar data on a regular basis, and i want to find a formula that will allow me to list the items based on different criterion.

View 2 Replies View Related

If Match Then SUM? - Wanting To Add Multiple Values If Criteria Matches

Mar 26, 2009

Column A would be Recipe Numbers, Column B the Planned Total.

I want to search column A for all matching recipe numbers.
Then, any recipes that match, look in column B for the planned totals, adding all incidents where they match.

Then the most difficult part, which just occured to me now.
I only need the Total Planned Total and Recipe name reported once.

Recipe#..........Planned Total

I will not be able to sort these lists.

If-Match-Sum? to display:
Recipe#............Total Planned Total

I've researched for the first part... and it seems like Match will only find the first match and not look further? Am I wrong on this?
How to display the results hadn't even occured to me yet, since I was still trying to figure out how to GET the result.

View 6 Replies View Related

Forcing Advanced Filter To Cancel Criteria If Found No Matches.

Nov 25, 2009

I have a advanced filter that works pretty much close to how I want it to. However I would like it to either cancel the new filter or copy everything if it finds 0 matches.

If the copied location is blank it breaks my sheet. So I need to find a way for it to never be blank, either by canceling it, copying everything, or finding some other way I haven't thought of.

Also for some reason my Advanced Filter does NOT Ignore blank "OR" cells. If I place a word in the top cell, then leave the bottom blank, it searches for the top cell or anything and I end up with everything. Its quite frustrating.

View 3 Replies View Related

Macro Used Textbox In Worksheet Rather Than Cell Reference As Criteria To Find Matches

Sep 26, 2013

This is a continuation of thread 182629 [URL] ....

The End User wanted originally to type characters into cell C1 of a worksheet that the macro searched for in another worksheet, copying across every row containing the input.

The responses gave me the following code which worked perfectly:

With Sheets("PICKLIST")
myFind = "*" & .[c1].Value & "*"
End With
If myFind = "*" & "" & "*" Then Exit Sub

Unfortunately, the user NOW wants a Text Box instead of putting the characters into a cell.

I added a textbox (originally called 'TextBox2' but renamed "Choice") and "Dimed" CHOICE As Range.

Then tried the following code:

With Sheets("PICKLIST")
myFind = "*" & CHOICE & "*"
End With

But it generates a "RunTime Error 91" - Object variable or With block variable not set.

View 8 Replies View Related

Finding Matches From Column B Within Column A

Apr 6, 2012

Here is what I am trying to accomplish.

I have to columns.

I have copied column A from a PDF file. It contains entries like this, all in the same column:

5 0.002HP Direct- 26845 7/1959 Airesearch

This column contains an ID # (5), a description (0.002HP Direct), a part # (26845), a date (7/1959), and a manufacturer (Airesearch). All this info is in one column. This column is 11,000+ entries long.

I have column B which is 45,000+ entries long, and contains ONLY part numbers, like this:


I would like to compare column B to find the matching results from within the text of column A, and put these matches into column C.

View 3 Replies View Related

Finding Max With A Criteria?

Sep 26, 2011

In a table 1 column are dates and another are machine parts. The dates are when that machine part broke last and a lot of the machine parts are repeated. Something like this

Column 1......Column 2
11/19/2010..Part 1
4/13/2010.....Part 1
9/13/2010.....Part 3
1/20/2010.....Part 2
10/11/2008...Part 2
2/1/2011.......Part 3

I'd like to find the last date the part broke. so the newest date. It would be nice if excel had a =maxifs() button. Can this be done without using a sub?

View 1 Replies View Related

Cross Check 2 Ranges For Matches & Return Row Number Of Matches

Apr 29, 2009

I have several worksheets (Labeled Sheet1,Sheet2,sheet3) What I need to do is to step through each row in sheet3, and do a search in sheet1, it the data was found, then return the row number. I then will need to copy data from sheet1 (rowfound columnA , through rowfound CoulmnBd to sheet3 current working row columnK

View 3 Replies View Related

Return Matches & Non-Matches From Delimited Cells Against List Range

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

Finding Median With Criteria

Dec 18, 2008

how would I find the median of a group of numbers? I have a database with a group of numbers associated with a part number. I need to find the median of each part. Here is what I have tried, but it doesnt work =MEDIAN(IF(A:A=A2,B:B))

View 5 Replies View Related

Finding Average With 2 Criteria.

Mar 10, 2009

I have 2 rows of data
1. title
2. value


Row 1: Title1, Title2, Title1, Title4, Title2, Title1
Row 2: 2 , 3 , 0 , 1 , 2 , 6

In the above I am looking for the average of Title1, where the value is greater than 0. There are 3 occurances of Title1, but only 2 have values. The answer i am after is Sum is 8, average is 4 (ie 8/2 and not 8/3)

View 3 Replies View Related

Copyrights 2005-15, All rights reserved