Create a summary list

Av8tordude

Well-known Member
Joined
Oct 13, 2007
Messages
1,074
Office Version
  1. 2019
Platform
  1. Windows
Can anyone help me with a VBA code that will take this list and create a summary list in column W-Y. Each item should have a subtotal like in the example in the next table. The Ticker and Name are in column A & B and the Amounts are in column P. The output should be place in in C.

Greatly appreciate i anyone could offer your assistance. Thank you kindly.


Ticker NameAmount

<tbody>
</tbody>

BAThe Boeing Company $(617.90)
AAPLApple Inc. $(118.67)
AAPLApple Inc. $ 131.34
AAPLApple Inc.$(238.07)
BAThe Boeing Company $(374.06)
BAThe Boeing Company $(101.09)
BAThe Boeing Company $ 36.92
SPYSPDR S&P 500 ETF $ 304.10
AAPLApple Inc. $(538.29)
SPYSPDR S&P 500 ETF $ 274.10
SQSquare $ 466.71
AAPLApple Inc. $ 87.77
IBMInternational Business Machines Corporation $ 262.10
NVDANVIDIA Corporation $ 708.93
SPYSPDR S&P 500 ETF $ 286.69
BAThe Boeing Company $ 933.90

<tbody>
</tbody>



ickerNameTotal

<tbody>
</tbody>

AAPLApple Inc.$($657.92)
BAThe Boeing Company$(122.23)
IBMInternational Business Machines Corporation$262.10
NVDANVIDIA Corporation$708.93
SPYSPDR S&P 500 ETF$(864.89)
SQSquare$466.71

<tbody>
</tbody>
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
How can I change this code to use COUNTIF. I want to count the number of instances of each value and put the results in column 22 ("V")

Code:
[COLOR=#333333]Columns(3).Formula = "=SUMIF(" & rData.Columns(1).Address & ",W1," & rData.Columns(3).Address & ")"[/COLOR]
 
Last edited:
Upvote 0
Try
Code:
"=COUNTIF(" & rData.Columns(1).Address & ",W1)"
 
Upvote 0
Thank you Peter. I'm not at my computer now however will this be inserted in column V?
 
Upvote 0
Thank you Peter. I'm not at my computer now however will this be inserted in column V?
I don't know because I'm not sure where everything else is and you just quoted 1 line of code so I just altered the formula part as best I could guess.
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

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