View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Per Jessen[_2_] Per Jessen[_2_] is offline
external usenet poster
 
Posts: 703
Default Need help with formula to search and compare data in differentcol

Hi Michael

I think you will need a macro to do that.

You say you have two spreadsheets to compare are they in the same
workbook.

I assume data start in column A on both sheets

Post some sample data for test purpose.

Regards,
Per




On 6 Apr., 15:57, Michael wrote:
Greetings!

I need help writing a formula to search through columns of data in two
spreadsheets, compare some values in each of the spreadsheets, and identify
any unpaired records.

Situation:

I have two spreadsheets that deal with the same entities.

In the first spreadsheet, I have 4 columns that make up a unique record:

PWSID (alpha num)
PWS Name (alpha num)
Facility Name (alpha num)
Approved Date (date)

In the second spreadsheet, I have 5 columns that make up a unique record:

PWSID (alpha num)
PWS Name (alpha num)
Facility Name (alpha num)
Actual Date (date)
Original Date (date)

What I need to do is the following:

For each unique record in the first spreadsheet, search the second
spreadsheet to find any records that match the following criteria:

1) PWSID and Facility names are identical; and 2) Either of the following is
true: *" approved date" in the first spreadsheet is +/- 2 days from "actual
date" or "original date" in the second spreadsheet.

For each record in the first spreadsheet, if it finds a record in the second
spreadsheet that meets the search criteria, I would want an 'OK' to be placed
in the first spreadsheet (new column). *If the search does not find a record
in the second, it should return 'No Record Found'.

Any help folks could provide would be greatly appreciated!

--
Michael