summing a range of column based on a matching value in another column

JeremyA1976

Board Regular
Joined
Aug 3, 2015
Messages
59
Step 1: I want to run a macro that will SUM a column range based on the values of matching column values in "A". For Instance, I will have single or multiple matching values located in column A. If Row 9 & 10 have a matching value of 1, I will want to sum column "D" for those two values. (D9 & D10), and then paste that value to the lowest row that matches in column J. (ex. J10 in above example).

Step 2: I want to run this if statement on that total and have it report in column K, right next to the sum value
=IF(J10="","",IF(J10<=400,6,IF(J10<=800,8,IF(J10<=1200,10,IF(J10<=1600,12,IF(J10<2200,14,IF(J10<=2800,16)))))))

I included an example of what I am looking to achieve, but I don't have a clue on how to write the macro and this is why I am looking for help. Can someone help point the way?

Thanks in advance,
Jeremy
 

Attachments

  • MacroPic1.PNG
    MacroPic1.PNG
    32.8 KB · Views: 16

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

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