Generate column of all values and the number of times they occur

shapeshiftingkiwi

New Member
Joined
Mar 31, 2021
Messages
33
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm starting with columns B and C and my desired output is column A. Column A gives the values in column B and the number of times they occur (column C). My actual use case is much larger and it's tedious to do this manually. Hoping this is as straightforward as I feel like it should be.

Master Brown Worksheet.xlsx
ABC
1All PumpkinsPrize Pumpkin WeightNumber of Prize Pumpkins at this Weight
28008003
38005561
48008742
55568002
6874
7874
8800
9800
Sheet4


Thanks!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try:
VBA Code:
Sub GenerateValues()
    Application.ScreenUpdating = False
    Dim rng As Range
    For Each rng In Range("B2", Range("B" & Rows.Count).End(xlUp))
        Cells(Rows.Count, "A").End(xlUp).Offset(1).Resize(rng.Offset(, 1)).Value = rng
    Next rng
    Application.ScreenUpdating = False
End Sub
 
Upvote 0
You are very welcome. :)
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,726
Members
449,465
Latest member
TAKLAM

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