View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Otto Moehrbach Otto Moehrbach is offline
external usenet poster
 
Posts: 1,090
Default Finding Office and Last Code Used on Acct Based on Multiple Critie

Robert
I can't follow your example. You say "for every account....". By
"account", do you mean the CustAccNum? If so, then, in your example, NY
doesn't go with CRED2 and CO doesn't go with CRED3.
Apparently I don't understand your example.
From what I do understand about what you want, you will have to this with
VBA. Please post back and tell me where I got on the wrong track. HTH
Otto
"Robert" wrote in message
...
I have a spreadsheet with the following columns: CustAcctNum;
TransactDate;
TransactCode; TransactAmt; OfficeLocation.

What I want to find out - for every account touched multiple times on
multiple dates, which OfficeLocation touched it first, then what was the
last
TransactCode (text field) used on the account by a different
OfficeLocation.
I have sorted the information by 1) CustAcctNum - Ascending 2)
TransactDate
(Ascending) and 3)TransactAmt (Descending). My issue is that there is not
a
set number of times an account was touched. Also, the last OfficeLocation
that touched it could have touched it multiple times on that date using
multiple codes. I am okay with getting the TransactCode for highest
dollar
amount on the last date the account was touched.
Example of data:

CustAcctNum TransactDate TransactCode TransactAmt OfficeLocation.
456 10/21/06 ADJ1 -5.00 NY
456 10/23/06 CRED1 -5.00 TX
456 10/23/06 CRED2 -7.50 TX
789 10/03/06 CRED1 -5.50 CO
789 10/03/06 CRED1 -3.40 CO
789 10/10/06 CRED1 -2.33 TX
789 10/22/06 ADJ1 -4.50 PA
789 10/22/06 ADJ2 -8.00 PA
789 10/22/06 CRED3 -10.22 PA

Basically my end result needs to be The office that touched it first and
the
code that was used last by a different office. There will not be an
instance
where the office that touched it first will also have touched it last. So
with the example above I would want my results to be

NY CRED2
CO CRED3

I have about 10,000 records to search through, but I can't figure out a
formula to return these values in columns side by side. Eventually, I
will
run another set of formulas against all the codes and locations I have to
see
how many times these instances occured. I have that formula already.

Is this possible?

Thanks for any help,

Rob