ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   if and help (https://www.excelbanter.com/excel-programming/415431-if-help.html)

[email protected]

if and help
 
Here is what I need to do:

Column G contains a claim number. L contains a combination of letters
and numbers, its a code, like v3.7 etc. Column M contains a code, a 4
digit number. Column S is paid amount. T is Overpayment. Column U
is reason code. I am looking for a macro, or even maybe an if and
statement with an offset that can do the below:

G L M
S T U
Claim Code R. Code Paid
Overpayment Reason Code
2308 v7.23 3802
$49.99
2308 v7.23 3802
$29.99 D
2308 v7.23 3809 $33.00
2816 v7.23 3809 $96.00
2917 v8.07 5039
$57.35 D
2917 v8.07 5039 $93.18
2917 v8.07 5039
$63.07 D
etc..

The data is sorted, by multiple fields. Claim number, code, r. code.
I want a macro, or possibly and if and then statement that will look
at for: If G2 = G3 and L2 =L3 and M2=M3 then I want it to put a D
offset into Column U for whichever is the smaller of the amounts in
the overpaid column.. So, in this example, the D would go into Column
U3. If they don't match, such as line 2308 and 2816 I want it to be
blank.

There may be times that there may be multiple one with the claim
number, code, and r code being the same if possible.

Documents are several thousand lines long, so you can see, going
through manually comparing these take a long time. Any help would be
greatly appreciated.

[email protected]

if and help
 
I redited since it messed up chart. You don't have to worry about T,
in this particular problem.


G * * * * * * * L * * * * * * * M S * * * * * * * *U
Claim * * * *Code * * * *R. Code * * *Paid *Reason Code
2308 * * * * *v7.23 * * * * 3802 $49.99
2308 * * * * *v7.23 * * * * 3802 $29.99 * * * * * *D
2308 * * * * *v7.23 * * * * 3809 * * * $33.00
2816 * * * * *v7.23 * * * * 3809 * * * $96.00
2917 * * * * * v8.07 * * * 5039 $57.35 * * * * * **D
2917 * * * * * v8.07 * * * *5039 * * * $93.18
2917 * * * * * v8.07 * * * *5039 $63.07 * * * * * * *D
etc..

[email protected]

if and help
 

I redited since it messed up chart. You don't have to worry about T,
in this particular problem.

G L M S U
Claim Code R. Code Paid Reason Code
2308 v7.23 3802 $49.99
2308 v7.23 3802 $29.99 D
2308 v7.23 3809 $33.00
2816 v7.23 3809 $96.00
2917 v8.07 5039 $57.35 D
2917 v8.07 5039 $93.18
2917 v8.07 5039 $63.07 D

Lars-Åke Aspelin[_2_]

if and help
 
On Sat, 9 Aug 2008 07:09:15 -0700 (PDT), wrote:


I redited since it messed up chart. You don't have to worry about T,
in this particular problem.

G L M S U
Claim Code R. Code Paid Reason Code
2308 v7.23 3802 $49.99
2308 v7.23 3802 $29.99 D
2308 v7.23 3809 $33.00
2816 v7.23 3809 $96.00
2917 v8.07 5039 $57.35 D
2917 v8.07 5039 $93.18
2917 v8.07 5039 $63.07 D



See my reply in another newsgroup

Bob Phillips

if and help
 
See response in public.excel.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
...

I redited since it messed up chart. You don't have to worry about T,
in this particular problem.

G L M S U
Claim Code R. Code Paid Reason Code
2308 v7.23 3802 $49.99
2308 v7.23 3802 $29.99 D
2308 v7.23 3809 $33.00
2816 v7.23 3809 $96.00
2917 v8.07 5039 $57.35 D
2917 v8.07 5039 $93.18
2917 v8.07 5039 $63.07 D




Rick Rothstein \(MVP - VB\)[_2524_]

if and help
 
You have multiple answers to your question in more than one newsgroup.
Please consider the following for any future questions you may ask...

From a post by Jeff Johnson:

"You have posted this question individually to multiple groups.
This is called Multiposting and it's BAD. Replies made in one
group will not be visible in the other groups, which may cause
multiple people to respond to your question with the same answer
because they didn't know someone else had already done it. This
is a waste of time.

If you MUST post your message to multiple groups, post a single
message and select all the groups (or type their names manually
in the Newsgroups field, separated by commas) in which you want
it to be seen. This is called Crossposting and when used properly
it is GOOD."

Some additional comment previously posted by me:

"You may not see this as a problem, but those of us who volunteer
answering questions on newsgroups do see it as a problem. You can't
imagine how annoying it is for a volunteer to read a question,
research background material, test sample code and then formulate
and post an answer to the original question only to go to another
newsgroup and find the question posted and ALREADY answered over
there. On top of that, if you cross-post your question, all of the
readers in all the newsgroups it is cross-posted to see both the
original question and all of the answers given to it. This is
beneficial to you because then we can add additional material to,
add clarification to, as well as add additional examples to an
answer you have received previously... that means you end up with
a more complete solution to your problem. This is a win-win
situation for all of us."

Rick



All times are GMT +1. The time now is 09:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com