Reverse SumIF: return column values based on sum criteria

mir994stan

New Member
Joined
Jul 18, 2021
Messages
42
Office Version
  1. 2016
Platform
  1. Windows
Greetings,
I don t know if i made good title, but i have no other idea how to call this question :) I tried search with some keywords, but with no luck. I was wondering if its possible to write a code to do reverse SumIF, to return all values from colum A whose sum is equal to value is some cell.
I have a table, (not pivot table) with 3 column A, B and C and x rows. In column A are serial numbers, column B have names, and column C have amounts for each serial in column A, all values are in ascending order. What im trying to achive is if i enter a name that exist in column B, in cell lets say L2, and in cell M2 i write a number for example 540. Macro should search for all names in column B and sum all values in column B until its that sum is matched with value from cell M2, and for those sum return all values from column A in order smalles to largest? I made example of how that should work ( i made it manually).
Thanks in advance. If its unclear what i would like to achive, feel free to comment. God bless you.
Capture.PNG
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,681
Messages
5,838,762
Members
430,567
Latest member
carid

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
Top