Compare Data and Show Differences

VBA~NOOB

Banned
Joined
Jun 5, 2014
Messages
14
Hello,

I have four columns of data - column "a" has a name column "b" has a dollar amount column "c" has a name and column "d" has a dollar amount.

I want to compare the names in column "a" to the names in column "c" and if they match subtract column "b" from column "d" to show the difference.

I've tried everything I can think of, but can't get it to work.

Any assistance would be appreciated.

Thank you
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Ok, so you want them subtracted no matter what. That's also easy enough. For starters, you could make a pivot table. But if you don't want to do that, then just use a sumif function.

Code:
=SUMIF($A:$A,$C1,$B:$B)-D1
 
Upvote 0
Ok, so you want them subtracted no matter what. That's also easy enough. For starters, you could make a pivot table. But if you don't want to do that, then just use a sumif function.

Code:
=SUMIF($A:$A,$C1,$B:$B)-D1

Sorry there's always a caveat.. Not everyone in column "a" is in column "c" and vice versa
 
Upvote 0
So...I don't see the problem with that point. If they aren't listed in column A, it will return 0-D1, which is still a result. If they aren't in column D, they won't be calculated. What is the end goal here? I seriously think a pivot table is what you need to look at based on the bits and pieces of discussion.
 
Upvote 0
If there is no value in column "a", but a value in column "c" it returns with the value in column "c"
 
Upvote 0
If there is no value in column "a", but a value in column "c" it returns with the value in column "c"
 
Upvote 0

Forum statistics

Threads
1,216,038
Messages
6,128,447
Members
449,453
Latest member
jayeshw

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top