# if column is = then add up other column

#### ExcelTom

##### Board Regular
I would like to compare column C records to see if equal. Say column C row 1 and 2 are "TOM", then look at column D and add D1 and D2 together and put it in column E2 for a total of D1 and D2.

Is that possible? What should the formula look like?

Thanks, for any help.

### Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

#### etaf

##### Well-known Member
what happens if row 4 and say row 10 = tom do you want
D1, D2, D4 and D10 added together

#### ExcelTom

##### Board Regular
Yes, if it matches in column C I would like it all to be tabulated together no matter if the rows are seperated. Whatever the simplest way is, if the total is shown in column E for each of those rows that would be fine, I can work with that.

Thanks.

#### etaf

##### Well-known Member
SUMIF() should do that , but would show in all rows

if you know the range
perhaps something like

=IF(COUNTIF(C2:\$C\$20,C2)=1,SUMIF(\$C\$2:\$C\$20,C2,\$D\$2:\$D\$20),"")

so if the range is C2 & D2 to C20 and D20 , as shown in the formula above - just change the 20 to whatever is the maximum range of rows

should only enter the value in the last cell that the value TOM is found
or any other name in the list

Last edited:

#### ExcelTom

##### Board Regular
I tried that formula and it is only returning values of zero. I expanded the range, but that didn't help.

#### ExcelTom

##### Board Regular
Alright, found the problem. It was reading the numbers as text. Thanks.

Replies
8
Views
833
Replies
9
Views
749
Replies
9
Views
346
Replies
6
Views
497
Replies
8
Views
2K

1,191,719
Messages
5,988,292
Members
440,148
Latest member
sandy123

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back