# Thread: when cell data matches, add up cells to the right (excel 2002)

1. ## when cell data matches, add up cells to the right (excel 2002)

I am having a issue with arragment of my data.

In 1 columns I have SO numbers ([img]/forums/images/smilies/cool.gif[/img], and in another I have amounts (D)

I have a scenerio that if the SO numbers in column B are the same, then add both the amounts together and show only one amount for that SO number, if the SO numbers are different leave the amount alone.

the new amounts can be placed in column H.

Thanks,

I wrote a condtional IF statement but it

2. ## Re: when cell data matches, add up cells to the right (excel 2002)

Put the formula below in cell H2 and then copy it down as far as necessary. Does this do what you want?

<code>
=IF(B2=B3,D2+D3,"")
</code>

3. ## Re: when cell data matches, add up cells to the right (excel 2002)

Yes it does but it skips the so numbers that dont have doubles, If I can also show the amounts for only one SO

4. ## Re: when cell data matches, add up cells to the right (excel 2002)

Sometimes there may even be Three same SO numbers aswell.

5. ## Re: when cell data matches, add up cells to the right (excel 2002)

How about in H2 (copy down as required. expand the "694"s as needed)
<pre>=IF(COUNTIF(\$B\$1:B2,B2)>1,"",SUMIF(\$B\$1:\$B\$69 4,B2,\$D\$1:\$D\$694))</pre>

Steve

6. ## Re: when cell data matches, add up cells to the right (excel 2002)

OK, then try this formula. You will need to adjust the 2000 in the fomula if there can be more than 2000 rows of data.

<code>
=IF(AND(B2<>"",B2<>B1),SUMIF(\$B\$1:\$B\$2000,B2,\$D\$1: \$D\$2000),"")
</code>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•