duplicate rows based on cell value...

Urraco

Board Regular
Joined
Apr 19, 2021
Messages
69
Office Version
  1. 2016
Platform
  1. Windows
Hello Mr Excel

many times I have to solve this type of list
I need to multiply each cell from column A based based on the number in column B, then add count number from each unique name
how to do this job faster instead of doing it manually?
thank you very much

Book1.xlsx
ABCDEFGHI
1noname...to duplicate…to count>>>nonameduplicatecount
21José Luis21José Luis21
32Juan51José Luis22
43Miguel Ángel32Juan51
54José12Juan52
65Francisco72Juan53
76Jesús32Juan54
87Antonio42Juan55
98Alejandro23Miguel Ángel31
109Pedro33Miguel Ángel32
1110Juan Carlos43Miguel Ángel33
12114José11
135Francisco71
145Francisco72
155Francisco73
165Francisco74
175Francisco75
185Francisco76
195Francisco77
206Jesús31
216Jesús32
226Jesús33
237Antonio41
247Antonio42
257Antonio43
267Antonio44
278Alejandro21
288Alejandro22
299Pedro31
309Pedro32
319Pedro33
3210Juan Carlos41
3310Juan Carlos42
3410Juan Carlos43
3510Juan Carlos44
3611
Sheet1
Cell Formulas
RangeFormula
I2:I35I2=COUNTIFS($G$2:G2,G2)
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
How about
Cell Formulas
RangeFormula
F2:H38F2=IF(ROWS($F$2:$F2)>=MAX($D$2:$D$100),"",INDEX(A$2:A$100,MATCH(ROWS($F$2:$F2),$D$2:$D$100,1)))
I2:I38I2=IF(G2="","",COUNTIFS($G$2:G2,G2))
D3:D12D3=C2+D2
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0
You're welcome & thanks for the feedback.
I apologize for coming back, but I didn't notice at first..
if I only have one row, this formulas is no longer works...
can it work in case I only have one row?
thank you

Book2
ABCDEFGHI
1nonameto duplicateto countnonameduplicatecount
21Juan9    
3    
Sheet1
Cell Formulas
RangeFormula
A2A2=IF(B2="","","1")
F2:H3F2=IF(ROWS($F$2:$F2)>=MAX($D$2:$D$100),"",INDEX(A$2:A$100,MATCH(ROWS($F$2:$F2),$D$2:$D$100,1)))
I2:I3I2=IF(G2="","",COUNTIFS($G$2:G2,G2))
 
Upvote 0
You need to add the running sum to col D like
Fluff.xlsm
ABCDEFGHI
1nonameto duplicateto countnonameduplicatecount
21Juan911Juan91
3101Juan92
41Juan93
51Juan94
61Juan95
71Juan96
81Juan97
91Juan98
101Juan99
11    
12    
Sheet4
Cell Formulas
RangeFormula
A2A2=IF(B2="","","1")
F2:H12F2=IF(ROWS($F$2:$F2)>=MAX($D$2:$D$100),"",INDEX(A$2:A$100,MATCH(ROWS($F$2:$F2),$D$2:$D$100,1)))
I2:I12I2=IF(G2="","",COUNTIFS($G$2:G2,G2))
D3D3=D2+C2
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,405
Members
449,157
Latest member
mytux

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