Sum Column C by Individual Destinations in Column A & Place Sum Total in matching Individual Destination in Column E

BURKMANTSU

New Member
Joined
Jun 25, 2018
Messages
2
Office Version
  1. 365
Platform
  1. Windows
ABCDEFG
DestinationP/VPupVanDest. 2Pup TotalVan Total
003p1001
003v1002
004v1003
004p1004
005p1005
009p1006
012v1007
030v1008

<tbody>
</tbody>


All Columns go to 500. Column A for Destinations is not set and can change depending on the data entered. Column E is a list of all Destinations. Both Columns A & E have a range of 001 to 498.

I want to sum Column C for each Destination in Column A and place these totals into Column F into the correct Destination. I will also want to do this for Column G as well.

I just want to know the total number of pups & vans from Column A and have those totals shown in Columns F & G.

I appreciate any advice/suggestions.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Welcome to Mr Excel forum

Try
Formula in F2 copied across and down
=SUMIF($A$2:$A$500,$E2,C$2:C$500)

Hope this helps

M.
 
Upvote 0
Try:
Code:
Sub sumDest()
    Application.ScreenUpdating = False
    Dim LastRow As Long
    LastRow = Sheets("Sheet1").Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
    Dim rngUniques As Range, dest As Range, foundDestRow As Long
    Sheets("Sheet1").Range("A1:A" & LastRow).AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range _
        ("A1:A" & LastRow), Unique:=True
    Set rngUniques = Sheets("Sheet1").Range("A2:A" & LastRow).SpecialCells(xlCellTypeVisible)
    If Sheets("Sheet1").FilterMode Then Sheets("Sheet1").ShowAllData
    For Each dest In rngUniques
        foundDestRow = Range("E:E").Find(dest).Row
        With Cells(1, 1).CurrentRegion
            .AutoFilter 1, dest
            Cells(foundDestRow, "F") = WorksheetFunction.Sum(Range("C2:C" & LastRow).SpecialCells(xlCellTypeVisible))
            Cells(foundDestRow, "G") = WorksheetFunction.Sum(Range("D2:D" & LastRow).SpecialCells(xlCellTypeVisible))
            .AutoFilter
        End With
    Next dest
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Yes, thank you! At first, each column showed zeros for the sum. Column C & D are "if" formulas based on Column B. I inserted a Column in between C & D, used =INT(c2) in column D, updated the formula and all of a sudden the sum totals worked. Must be something with the formatting with the "if" formula.

Again, thank you for the formula for the sums!!!
 
Upvote 0

Forum statistics

Threads
1,215,330
Messages
6,124,308
Members
449,152
Latest member
PressEscape

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