Repeat different values based on adjacent column numbered inputs

Drew_

Board Regular
Joined
Jul 8, 2017
Messages
89
Office Version
  1. 365
Platform
  1. Windows
I'm trying to have values repeat a specified number of times, but the number can be different and is determined based on a drop down. I've attached a screenshot here:

1737656604000.png


I would like a formula in G1 that says "For all values that equal "Yes" in Column C, repeat the corresponding values in Column B the specified times in Column D. If anything equals "No" or is blank in Column C, ignore it" and have it be an array output in Column G. I can get =REPT(B2,SEQUENCE(D2,1,1,0)) to work for just the first input but it's not scalable nor dynamic.

Any help anyone can provide is much appreciated!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
Excel Formula:
=TOCOL(IF((C2:C100="yes")*(SEQUENCE(,MAX(D2:D100))<=D2:D100),B2:B100,1/0),2)
 
Upvote 1
Solution
Thank you for the tip about the Account Details, I've gone ahead and updated that and saved it.

You are a GENIUS, this works perfectly!! Thank you very much.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,226,059
Messages
6,188,637
Members
453,487
Latest member
LZ_Code

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