VBA Macro to replace Sumif that ignores duplicates.

gmittar

Board Regular
Joined
Sep 16, 2013
Messages
62
Hi All,

I'm trying to come up with a way to combine index functionality (look up row/column) with sumif functionality. I want to look up a column, and then sumif everything in that column that matches my criteria.

I've managed to do the above with an array formula, but there are complicating factors.

1) The sumif target column contains duplicates. I've pored through Aladin's posts on this forum, and I have an idea of how to approach this, although I haven't pulled it off yet.

2) There are multiple criteria, and they all need to be summed. In this instance, I'm trying to sumif based on all of the GL codes in a category. I don't want to repeat the formula for every code.

Summary: I want to look up a column based on a criteria, and in that column, sum every cell that matches a range of other criteria, while ignoring duplicates (but still adding the first value in the duplicate sets). Aladin approached this by counting duplicates and dividing by the number of counts, which could work.

I saw someone mention this would be easy to do in VBA, and I'm comfortable enough with VBA to do it that way if I can get a good directional start.

Much appreciated.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Friendly bump.

Lots of views, no responses. Is this something that is outside of Excel's capabilities? Is my description less clear than it should be? Would visuals help?
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,179
Members
448,948
Latest member
spamiki

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