Microsoft Excel - Need to match values from sheet A to Sheet B, and return a date from Sheet B to Sheet A

Asked By Tammy on 28-May-13 09:34 AM
I think this is simple, but not sure how to get started! All data is in the same Excel file.
Sheet A:
Column A (Client Name)   Column B (Date)

Sheet B:
Column A (Client Name)   Column B (Date)


I need to look at the client name in Sheet A Column A, and "find" that same client name in Sheet B Column A. Whatever date is in Column B for that client, then I need that date to be pasted into Sheet A, Column B for that client.
Harry Boughen replied to Tammy on 28-May-13 06:07 PM
Hello Tammy,
It will depend a bit on whether every client on SheetA(1) is in the list on SheetB(2) or not.
You could start with something like this in Sheet1!B1 and copy down:
=SUMPRODUCT((Sheet2!$A$1:$A$4=Sheet1!A1)*Sheet2!$B$1:$B$4)
It will give a zero value (0-Jan-00 in date format) if the client is not there so if you want something else then you would need to add the logic to test for zero and put in the necessary alternate.
Let me know how you go.
Harry
Donald Ross replied to Tammy on 28-May-13 11:42 PM
You can do the same thing with =vlookup(lookup_value,Table_array,column_index) 
value will be sheetB client name cell, array will be sheet A Column A?:B? (start of data to end in B,  Index column will be 2 meaning take the data from the corresponding client name row 2nd column.

hope this made sense.
Harry Boughen replied to Donald Ross on 29-May-13 01:16 AM
Hi Donald,
VLOOKUP has a problem if the lists are not in the same order and suffers from giving a false reading if the lookup_value does not appear in the Table_array.
Regards
Harry
Donald Ross replied to Harry Boughen on 29-May-13 09:15 AM
Harry I thought about that when it comes to dates and the values not being in ascending order but if you are searching for the client's name in column A and not a date will it still give you the same problem, I did have this happen before with a checkbook style layout and had help before. 

either way thank you for the feedback I need to make a sheet and try it. 

Don
Bill B replied to Donald Ross on 18-Jun-13 01:18 AM
you still might be better off with your access db

play with distinct
group by
having clause

learn it.

If that's too much trouble, then you can simply learn how to loop a recordset with some if statements.

It's not difficult, but for your first time it will be.

Isn't this almost the same thing as your other post?

Bill B replied to Tammy on 18-Jun-13 01:23 AM
you still might be better off with your access db

play with distinct
group by
having clause

learn it.

If that's too much trouble, then you can simply learn how to loop a recordset with some if statements.

It's not difficult, but for your first time it will be.

Isn't this almost the same thing as your other post?
I could be wrong.


Instead of using excel as your data storage, move on up...use a table in access.

Then you can do all sorts of things which are easy.

The reason you have another sheet is that you want a report/view of some data combination.

It's easier when it is in a table. Really. Its worth your time to learn it, as you can then do anything you ever wanted or can dream up.  The things you ask for are done within minutes or less by me, and you can too.

Convert your data for both to a table.

Then you can you drag and drop query until you learn the SQL (structured query language)...
with it you can create new custom fields that do not exist in the table...

to satisfy you desired output.


really, it will be easier for you to put it in access db

if you don't have access, well...

you can use OpenOffice... and have something very similar

trying to paste values from one spreadsheet to another is more complicated than it is to write simple code using tables







Bill B replied to Tammy on 18-Jun-13 01:24 AM
and not to give up on just using excel


you could record the steps to select one value, then search the other table then paste
and repeat that

good luck with that though

seems harder to get the resulting vba script to work, but it is doable