Thread: If And Help?
View Single Post
  #28   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_1103_] Rick Rothstein \(MVP - VB\)[_1103_] is offline
external usenet poster
 
Posts: 1
Default If And Help?

Follow up note.... I modified the formula that Lars-Åke posted and it was
set to the exact size of the data, but this is not necessary. However, if
you do extend the coverage of rows to handle future data, then the
G$2:G$2<"" term (note I mistaken used G$24 for the end range in my previous
write up, but used it correctly in the formula) must be added to protect the
blank rows the formula is placed in. So, if you think you will have up to
5000 rows of data eventually, you can put this array-entered** formula in U2
(the original column the OP said he wanted the "D" in)...

=IF(OR(MAX(IF((G$2:G$5000=G2)*(L$2:L$5000=L2)*(M$2 :M$5000=M2)=1,S$2:S$5000))S2,SUM((G$2:G2<"")*(G$ 2:G2=G2)*(L$2:L2=L2)*(M$2:M2=M2)*(S$2:S2=S2))1)," D","")

and copy it down for 5000 rows and the display will be correct for both
empty rows and rows with data in them.

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Time to add the (G$2:G$24<"") term back in; otherwise the second and
subsequent blank rows get tagged with a "D". The final array-entered**
formula is...

=IF(OR(MAX(IF((G$2:G$10=G2)*(L$2:L$10=L2)*(M$2:M$1 0=M2)=1,S$2:S$10))S2,SUM((G$2:G2<"")*(G$2:G2=G2) *(L$2:L2=L2)*(M$2:M2=M2)*(S$2:S2=S2))1),"D","")

** commit the formula using Ctrl+Shift+Enter, not just Enter by itself

Rick


"Lars-Åke Aspelin" wrote in message
...
Try this formula in cell U2 and copy down.

=IF(OR(MAX(IF((G$2:G$10=G2)*(L$2:L$10=L2)*(M$2:M$1 0=M2)=1,S$2:S$10))S2,SUM((G$2:G2=G2)*(L$2:L2=L2)* (M$2:M2=M2)*(S$2:S2=S2))1),"D","")

This will "D-mark" all but the first of the rows that are identical in
all four columns (G, L, M and S) in addition to the previous criteria.

Hope this helps / Lars-Åke

On Tue, 12 Aug 2008 10:06:54 -0700 (PDT), wrote:

Gentlemen, 1 last question. The formula works GREAT! I can't stress
that enough. It didn't dawn on me until last night: Sometimes we
have instances that there are duplicates (multiple rows) with the same
claim, code, r.code, and paid amount. Right now the formula is
marking all values that meet the criteria (same claim, code, r.code)
that is less than the max amount. That is great :) Is there a way
to also have it mark any others that meet the criteria (same claim,
code, r.cod) that have the same paid amount? So, for instance, below,
I added the last 2 lines just now. I still want it to do what it did
before, but also mark all but one of the max amounts... If not clear,
I have my work around below this. I'm sure I can save some computing
power and time if it can be added into the array. If not, no
biggie :) I appreciate everything you guys have done :)

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 3802 $33.00 D
2308 v7.23 3802 $49.99 D
2308 v7.23 3802 $49.99 D

My Work Around:
I created 2 more columns, V&W
I entered in the formula you guys created :) as an array, and filled
it all the way down in column V
In column W I did this formula:
=IF(AND(G2=G3,L2=L3,M2=M3,S2=S3),"D","") and filled it all the way
down.
I copy and paste special: values for both column V&W. I autofilter
both individually for blanks, selected visible, deleted blanks.
In column U: =IF(V2&W2="", "", "D") autofilled it down so I know if a
d has been placed in either V or W.

My work around would work, but it is flawed since we have excel 03 vs
the new one, we can only sort by 3 fields and the duplicate (equal)
charge amounts might not always be together as in the example. Yay!