Formula to repeat cells

natlmc4877

New Member
Joined
Jun 13, 2024
Messages
4
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
I have a spreadsheet with order numbers and email addresses. I need a formula to show.

Etc - If number in cell c2 is 2, copy cell b2 once and paste to cell f2
If number in c2 is 3, copy cell b2 twice etc.

Thanks so much!

1718319663028.png
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Is this what you mean?
Book1
ABCDEFG
1order_numberemailquantity
2KX6ZKtest@email.com.au4test@email.com.au
3test@email.com.au
4test@email.com.au
Sheet2
Cell Formulas
RangeFormula
F2:F4F2=IFERROR(EXPAND(B2,C2-1,,B2),"")
Dynamic array formulas.
 
Upvote 0
Ok, try:
Book1
ABCDEF
1order_numberemailquantity
2KX6ZKtest@email.com.au2test@email.com.au
3XGJGOtest2@email.com1test3@email.com
4ABCDFtest3@email.com5test3@email.com
5test3@email.com
6test3@email.com
7
Sheet2
Cell Formulas
RangeFormula
F2:F6F2=TOCOL(IFS(C2:C4>SEQUENCE(1,MAX(C2:C4)-1),B2:B4),2)
Dynamic array formulas.
 
Upvote 0
Solution
not quite working (i have changed the font to wingdings as it is email addresses)
keeps saying #CALC!

1718331889154.png
 
Upvote 0
It's a single formula. Grab the entire range. Clear everything below. See the post#4 again.
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,795
Members
451,589
Latest member
Harold14

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