Macro adding Sum if value is True

sstarnes

New Member
Joined
Sep 18, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I need assistance creating a Macro that will consolidate information into sheet1. It will need to search column B in a separate sheet, and if the value equals the value provided in row 2 of Sheet1 it will then add the sums of column C on the separate sheet only for those rows matching in column B and provide that sum in Sheet1.

i.e in Capture 1 it shows under Truck for 3 a total of 9.42 in D3, since in the Truck sheet there are 2 lines with a value of 3 so 6+3.42=9.42

TIA
 

Attachments

  • Capture 2.PNG
    Capture 2.PNG
    4.9 KB · Views: 3
  • Capture 1.PNG
    Capture 1.PNG
    20.2 KB · Views: 3

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,221,532
Messages
6,160,380
Members
451,643
Latest member
nachohoyu

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