View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Sting17 Sting17 is offline
external usenet poster
 
Posts: 3
Default formulas that matches data and subtract dates

Thank you. I tried both and both worked. One issue that I found was that I
need to sort by the "P1" and "P2" of the P1a and P2a. The "P1" data is the
pairing data, the "a", "b", and "c" just refers the time of the month it
happened. I guess that I have to create another column to read that data as
"P1" and "P2", then use that as the sort?
Thank you very much.

Sting

"Roger Govier" wrote:

Hi Sting

One way
Copy your data to another sheet - click on sheet tab, hold down Control,
as you drag your cursor to the right. This will create a duplicate of
the sheet.
On this copy of the data, in column D enter
=A1&B1
Copy down column D for the extent of your data.
Mark the whole block of data, then DataSortColumnDAscending
in column E enter the following in cell E2
=IF(D2<D1,"",(C2-C1)/7)

You show your data as in consecutive pairs, but I guess in reality the
data may be scattered throughout the table. The sort on the concatenated
filed will bring all of the like data together


--
Regards

Roger Govier


"Sting17" wrote in message
...
I am trying to combine a formula that does two different things;
matches
cities, a code for the city, and if it has a match, calculate the
difference,
in weeks between the two events.
ex.
Detroit, 1Pa, 04/06/04
Detroit, 1Pa, 06/23/04
Detroit, 1Pb, 08/01/04
Detroit, 1Pb, 11/05/04

I want to match the cities, and if they have a matching code, find out
the
time in weeks between the two event dates. Is this possible, and if
so,
HOW??? THANKS