Sum value in a column based on condition

Weasley0307

New Member
Joined
Dec 25, 2023
Messages
6
Office Version
  1. 2021
Platform
  1. Windows
Hi, I have a userform to trace the number of wooden pallet and wooden case that my company receive from and return to the vendor. I want to code the function that can automatically sum the quantity in column D based on 4 different categories as shown in the red circle (which I had manually keyed in).

Anyone can show me how do i code so that vba will know, for example, if we are receiving xx pallet, then it will only sum this category of data at D12? If we are returning back xx case then it will sum it in D16 etc. Thanks

1708590058720.png
 

Attachments

  • 1708589935770.png
    1708589935770.png
    25.9 KB · Views: 16

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Why don't you use the SUMIFS function?

Cell D12
Excel Formula:
=SUMIFS($D$3:$D$9,$B$3:$B$9,"Pallet",$C$3:$C$9,"Receive")
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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