# Lookup Column Values In Another & Return Value If Match Found

May 28, 2008
I need to create a macro that will loop through a list of names on Sheet 1 / Column A, and if that name is listed on Sheet 2 / Column A, then it will set Sheet 1 Column B (for that one name) to "1".

The problem I've run in to is that both the lists change in length each time I have to run this (so no set range).

I've been able to get this to work with two ( nested) loops, where the first loop goes through the Sheet 1 list and the nested Loop looks for the name on Sheet2, but it is extremely slow.

Is there any simple VBA code or formula that I'm missing that could do this? I've tried to do something with the " Find" VBA command, but I can't see how it would apply to this if the list changes in size.

View 8 Replies
ADVERTISEMENT
Jan 11, 2006

If lookup doesn't find a match in the first column, can I get it to return an

"ERR" or "0", something that would let me know there was no match? Right now

it returns the value in the second column of the closest value.

View 13 Replies
View Related
Jan 31, 2008

I've been searching the forums for this problem but I can't seem to find any answers. Anyway, this is the problem. See screenshot.

I want to compare A1 for the values in column B, then return the corresponding cell (column C) in column D.

e.g. D1 = 2, D2 = 1, D3 = 4, D4 = 5 and D5 = 3.

View 9 Replies
View Related
Jul 1, 2008

I have two excel sheets. The first sheet has a column with codes and another column with dates. There are more than one date for the same code. The second sheet has just one unique code. I would like to match the code on the second sheet with the code on the first sheet and return ALL the dates associated with that code to the second sheet - horizontally.

View 5 Replies
View Related
Apr 1, 2014

I am trying to use a formula similar to VLOOKUP() to look in a table for two values and if both values are found, return another value.

Sheet2 is an example of my output file, sheet one is a generated file. i would like the vlookup formula in sheet 2 cell D2 and down to be something like this,

=VLOOKUP(A2,Sheet1!A:K,10)

But I would like to lookup A2 and B2, and the row that contains both values, return the value in the J column

View 3 Replies
View Related
Jun 13, 2013

I'm using a formula to lookup names within text and return that name to a separate column if it's found.

The formula is =INDEX($E$1024:$E$1026,MATCH(FALSE,ISERROR(FIND($E$1024:$E$1026,E1010)),0))

I understand index and match functions, but I'm confused regarding the use of FALSE as the lookup value and the iserror(find( usage.

View 2 Replies
View Related
Jan 30, 2014

I'm trying to create a macro that can lookup values down a list, find that value within another list and copy the adjacent cells.

The values to look for will always be on the same column and the values to look into will always be in the same range or columns but not always in the same row.

For example.

AI:AI contains a list of ID's which will be manually input every day so they might have a different order.

C:AF has all the data to look into. C always being a list of ID values and I want for every ID found on AI:AI to be search for on C:C: and then once a match is found, I need specific adjancent cell values to be copied next to the ID found on AI.

The values that need to be returned are found on columns B,D,F,G,H,I,J,P,AF and they will always display on those columns.

I've been doing this based on vlookup and INDEX/MATCh formulas but I've come across some limitations for something I want to develop further so I'm trying to do this based on VBA.

View 5 Replies
View Related
Dec 10, 2007

Working on an export from an e-commerce application that lists the item purchased, unfortunately not by item #, but rather a lengthy description. I'm trying to construct an item number based on that description which contains several constants.

Each item ordered appears in a single row, comprised of ORDERID, QTY, PRODUCT DESCRIPTION

I have several tables to pick out PRODUCT TYPE, COLOR, SIZE, etc. I need a formula to search to see which of the unique values appears in each in the cell and return the shortcut of that value.

PRODUCT DESCRIPTION example "Sweater - Blue - Large - Wool"

TYPE TABLE:

Sweater SWTR

T-Shirt TSHT

Jeans JEANS

COLOR TABLE:

Blue BL

Green GN

Purple PL

Black BK

I would have separate tables for each part of the description.

The formula I'm seeking would search the PRODUCT DESCRIPTION cell for the range of values for each 'part'. So it would search to see which of Sweater, T-Shirt, or Jeans was in the cell and then return the one that was - SWTR in this example. I would modify this formula for each 'part', in its own cell, and then use an =cell#&"-"&cell#&etc... to combine these returned values.

I know I can write a large if- chain using ISERROR & FIND, though some of these lists will get lengthy.

View 9 Replies
View Related
Jun 5, 2009

I have a tab that has 2 columns of data and I want to be able to return a value in column A if my data matches column B. If column B has the text TRUETRUE, I want to bring back the corresponding data in Column A. How do I return all the data in Column A for all the TRUETRUEs in column B? I can only get the first instance of TRUETRUE.

View 4 Replies
View Related
Sep 3, 2009

I would imagine that the title of this thread made little sense, so let me try to explain:

Sheet A has columns A-C populated with data. Column D needs to search Sheet B columns A-C for a match. (ie, see if the data on sheet A is also on sheet B) if this is true, then it needs to return the value of the LAST column of the matched row in Sheet B.

So, if Sheet A R1 A-C is 1,2,3. Sheet A R1 D needs to search Sheet B for 1,2,3. and when it finds it, (for example on row 9) return the value of the last column of Sheet B row 9. The issue is, the last value could be in column R or S or AA, there is just no way of knowing.

View 9 Replies
View Related
Jan 15, 2014

The logic of the formula like this....

TAB X, Column A contains a data set, each row is a unique value. In column B of TAB X, I want to input a formula that performs the following logic: Search TAB Z, Column C, for an exact match of data contained in TAB X, Column A....and if found, look in TAB Z, Column D...if a blank cell is contained there, then in TAB X, Column A, say "Unsettled" ; however, if there does exist any character (not-blank) in TAB Z Column D, then in TAB X, COlumn A, say "Settled".....but, if the data ID listed in TAB X, column A is not found whatsoever in TAB Z, Column C, then say "NOT FOUND". So for example, within TAB X, Column A there is a unique ID in one of the rows "ABC123", then searches "ABC123" in TAB Z, Column C. If found, it looks in TAB Z, Column D and that cell is blank, so TAB X, Column B, same row that contains ABC123, the result is "Unsettled".

View 1 Replies
View Related
Jul 11, 2012

I have encountered a situation where I need to essentially accomplish a reverse Vlookup (using index match) and return multiple values.

View 1 Replies
View Related
Aug 25, 2007

I am trying to compare a single cell's Value in 1 worksheet to try to find a match in another column (or a range of cells). If I find a match I want the result to be a 1 and if it is not found then a 0.

Is this the Lookup function?

View 8 Replies
View Related
Dec 3, 2012

I am trying to look in B1:B100 for the Cell that matches A1 and C1:C100 for the cell that matches A2 then return the value from D1:D100 that meets the 2 criteria.

View 6 Replies
View Related
Sep 15, 2006

Im trying to create a formula that check to see if the value in H4 equal any value in the vlookup table m4:m48, if so, then Y, if not then N. the following does not work: =IF(ISNA(MATCH(H4,M$4:M$48)),"N","Y")

View 2 Replies
View Related
Apr 14, 2013

I know I can do this by nesting a load of if statements but I was wondering if there is an easier way.

If in cell A2 I have the value 12 and I want cell A1 to return a value FOUND if any cell from A6 to A24 has the value 12 in it.

View 3 Replies
View Related
Oct 26, 2006

I need to pull data from Column C by looking at Column A. However it's not as simple as that. Under Column A, there are various fields, the first number represents a type of product and under what year it is currently in. So "300100" would represent a 3 yr product that is in it's third year, "210000" would be a 2 yr product in it's first year and so on. The problem is that when I pull data from the DB, some 3 yr products are flagged as products that are in their 4th or 5th years, which isn't possible. So I created an IF statement that takes this into account and ignores illogical combinations.

=If(A2="300100",C2,If(A2="301000",C2,If(A2="310000",C2,If(A2="210000",C2,If(A2="201000",C2,If(A2="510000",C2,If(A2="501000",C2,If(A2="500100",C2,))))))))

As you can see, I don't have the conditions "500010" and "500001" because it won't fit into the IF statement. Is there another way to go about doing this task? I've searched up the forums and someone recommended using the IF statement with VLOOKUP but I don't think it works in this particular case since I have 10 conditions.

View 2 Replies
View Related
Mar 15, 2008

A have a table like this:

X 1 2

A 9 5

B 8 4

I would like to have a condition that when is equal to B and 2, return the corresponding paragraph in the matrix (in this case 4)

View 5 Replies
View Related
Mar 28, 2008

I have an excel sheet with cols of information e.g IDNo, FirstName,LastName etc. I have created a form in VB where you enter the IDNo (& Click on a command button called View) It should populate designated textboxes on the Form. Thus it should check the col where the IDNo is stored, find the IDNo and populate the adjacent cols i.e FirstName, LastName in designated textboxes on the form.

View 3 Replies
View Related
Jun 11, 2008

Essentially, sheet b is a list of 900 people I need to mail to. Sheet a has 3000 rows of people, many of whom don't need the mailing. It has mailing addresses that we need in sheet b.

We have two worksheets, sheet a and sheet b

compare sheet b, column c (email addresses) to sheet a, column x, (email addresses).

If they match, move sheet a, columns d, e, f, g, and h to sheet b.

View 3 Replies
View Related
Apr 3, 2014

In cell b2 I have a formula =text(today(),"yyyy") which daisplays todays date as a year, in cell b3 I have =text(today(),"mmmm") which displays todays date current month.

I have a column of Months and Years

January 2014

February 2014 etc

I need todays (current) month and year to indicate in a helper column next to the relevent month and year as a number 1 to use as a reference to return date from the row where the 1 is displayed, I have tried =if(and(b2=a10,b3=b10),1,"")) and it dosent like the fact that the year in the colmuns is entered as standard text, is there any whay to do this?

View 8 Replies
View Related
Dec 26, 2013

table1.jpg

I am looking for a formula that will satisfy the following:

1) find all the values in column "A" that match

2) In column "G", sum up all the values in "F" that go with the matching values in column "A"

3) For example, in rows 14-16, the values in column "A" match. Cell G16 sums up F14:F16

View 3 Replies
View Related
Mar 13, 2014

I have a list of ID Numbers and Dates. Let's call this "List 1".

I also have a second list "List 2" which also contains a list of ID Numbers and Dates as well as a third column for Rating.

I am trying to extract the Rating for each ID Number from List 2 and display in List 1. The problem is that the Rating can change with time, so List 2 contains several different Date and Rating values for the same ID Number.

What I need to do is lookup the ID Number from List 1 and return from List 2, for that ID Number, the Rating at the closest date prior to the date for that ID Number in List 1. Example below:

List 1

List 2

ID Number

Date

Rating

111

17/04/13

5

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

View 9 Replies
View Related
Jul 30, 2008

Is it possible to write some VBA code that will copy IDs from Sheet1 and then find these IDs in Sheet2 and return the values these IDs have?

View 4 Replies
View Related
Nov 11, 2013

Attached is a sample file.

I can't figure out a formula that will match either 1,2,or0 in column K and offset to corrosponding value in column B. Then average of all values that came up.

how to accomplish this. VBA is acceptable, but formula is prefered.

0.644

0.627

0.641

[Code]....

View 5 Replies
View Related
Nov 14, 2009

I have exported an income statement report from the ERP system to Excel. Only items that are not equal to zero are populated. So if there has been no expense in the Central division for Consulting fees, it does not show up on the report. Here is the formula:use control shift and enter

small(if(row(A1:A100)-ROW(A1)+1>MATCH("Central Division",A1:A100,0),if(A1:A100)="Consulting Fees",ROW(A1:A100)-ROW(A1)+1)),1)(

Excel Jeanie HTMLSheet2

A 2 East Division 3 Sales 4 Cost of Sales 5 Payroll 6 Lights 7 Consulting Fees 8 Net Profit 9 10 Central Division 11 Sales 12 Cost of Sales 13 Payroll 14 Lights 15 Net Profit 16 17 West Division 18 Sales 19 Cost of Sales 20 Payroll 21 Lights 22 Consulting Fees 23 Net Profit

Excel tables to the web >> Excel Jeanie HTML 4

So this formula picks up the first Consulting Fees after the Central Division. The problem is it is going to pick it up under the West Division. So, how would I modify the formula so that if the row number is also less than Central Division Net Profit (A15), it is zero. (no offset or indirect)

View 9 Replies
View Related
Jan 8, 2012

I have long text values that include names in cells A1:A100.

In cell D1:D10, I have a list of names that I would like to check if any of them is found in each of the cells in A1:A100 and if yes, return TRUE in column B.

So in a way, what I need is a a bit like the SEARCH function, only that I need to find multiple FIND_TEXT values. If just one of the names in D1:D10 is found, the formula should return TRUE.

View 4 Replies
View Related
Nov 27, 2013

I have an excel sheet with multiple columns. In one column I have X's and in another I have a limit. I need to look down the stuff column, find every X, match each X to its corresponding limit and then compare all the limits and return only the smallest limit found. I.e if I was looking down the stuff column I would find 4,6,8,8,3 and thus I would return 3 as my value. I am very new to working with excel formulas,

limit

something

stuff

4

x

[Code]....

View 4 Replies
View Related
Mar 17, 2009

I am trying to modify this formula to do one more thing, but I can't quite figure out how to do it. I have part 1 and 2, but part 3 is giving me a very hard time. The formula is not working correctly. It is supposed to do several things.

Do an HLookup for a row and return the last value in the row.If there is no value (blank), the value should be "Incomplete."If HLookup finds a value of "Fail," it should look to see if there is a value of "Pass" BEFORE (to the left of) "Fail." If this exists, then it should return a value of "OK."

Here is what I have so far....

View 9 Replies
View Related
Feb 4, 2014

I have two sheets of data , sheet A and Sheet B.

Sheet B contains a column called "Name" and for each name, and for each name there are corresponding numbers. In sheet A, I have a "list of interest" in column A. What i want to do look through the data in sheetB to find a match from the list of interest and return the corresponding letters, located in column A.

I have filled out the first two rows of results that should be returned as an example.

One idea i had was to put a vlookup formula in each column result 1 to result 6 so i can catch all 6 "Serves" columns from column B, but there may be duplicates in the serve columns and vlookup only reports the first match.

View 3 Replies
View Related