close

My file has account numbers in column A. Some may be duplicates, some may
not. In column B their are different values for each account. In column C
the duplicate numbers in A have the same value. I used conditinal formating
to identify the duplicate numbers in red. Now I need to be able to sort by
the values in A so that the duplicates are all together. Once I get them all
together, I can write and if stmt to add the two values in column B. Is
there a statement that I can use in D that would look at A and if red then
return a value of x if not return a different value? Example below the acct
number 4 I need to end up with 4 55 27. All the other rows are okay.
A B C
1 50 20
2 10 40
4 35 27
4 20 27

There's no statement in Excel which says quot;if a1 is redquot;. You need VBA for that.
However, you can accomplish the same thing with an if statement that has the
same condition as your conditional format (ie, in your case a4=a3).

You might also want to look at sumif. In column D, enter =sumif(A:A,A2,B:B) and
copy down. Then use advanced filtering to eliminate the duplicates in A.

--
Regards,
Fredquot;Jeannequot; gt; wrote in message
...
gt; My file has account numbers in column A. Some may be duplicates, some may
gt; not. In column B their are different values for each account. In column C
gt; the duplicate numbers in A have the same value. I used conditinal formating
gt; to identify the duplicate numbers in red. Now I need to be able to sort by
gt; the values in A so that the duplicates are all together. Once I get them all
gt; together, I can write and if stmt to add the two values in column B. Is
gt; there a statement that I can use in D that would look at A and if red then
gt; return a value of x if not return a different value? Example below the acct
gt; number 4 I need to end up with 4 55 27. All the other rows are okay.
gt; A B C
gt; 1 50 20
gt; 2 10 40
gt; 4 35 27
gt; 4 20 27

hi!

why don't you try

=SUMPRODUCT(--(A1:A4=4),--(C1:C4=27),(B1:B4))

assuming that your data in A1:C4

-via135--
via135
------------------------------------------------------------------------
via135's Profile: www.excelforum.com/member.php...oamp;userid=26725
View this thread: www.excelforum.com/showthread...hreadid=531116

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()