Formula Help - Replicate each Cell down muliple rows

Queenofmycastle

Board Regular
Joined
Oct 27, 2009
Messages
62
Office Version
  1. 2016
Platform
  1. Windows
Sheet 1
A B
1 Red 2
2 Blue 3

Sheet 2
A
1 =Sheet1!A2
2 =IFERROR(IF(COUNTIF(A$2:A2,A2)=VLOOKUP(A2, Sheet1!$A$2:$B$3,2,0), INDEX(Sheet1!$A$2:$A$3,SUMPRODUCT(1/COUNTIF(Sheet2!A$2:A2,Sheet2!A$2:A2)) + 1, 1), Sheet2!A2)," ")

Sheet2 Results
Sheet 1
A
1 Red
2 Red
3 Blue
4 Blue
5 Blue

The above formula works perfectly except that the example only included 2 rows of data, I want it to be able to continue if I have 10 colors or even 100 colors. I can't figure out where the limitation Help is appreciated!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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’)
 
Upvote 0
Thanks for that.
How about
Excel Formula:
=IFERROR(IF(COUNTIF(A$2:A2,A2)=VLOOKUP(A2, Sheet1!$A$2:$B$100,2,0), IF(INDEX(Sheet1!$A$2:$A$100,SUMPRODUCT(1/COUNTIF(A$2:A2,A$2:A2)) + 1, 1)="","",INDEX(Sheet1!$A$2:$A$100,SUMPRODUCT(1/COUNTIF(A$2:A2,A$2:A2)) + 1, 1)), A2),"")
 
Upvote 0
=IFERROR(IF(COUNTIF(A$2:A2,A2)=VLOOKUP(A2, Sheet1!$A$2:$B$100,2,0), IF(INDEX(Sheet1!$A$2:$A$100,SUMPRODUCT(1/COUNTIF(A$2:A2,A$2:A2)) + 1, 1)="","",INDEX(Sheet1!$A$2:$A$100,SUMPRODUCT(1/COUNTIF(A$2:A2,A$2:A2)) + 1, 1)), A2),"")


You nailed it! So.... Our IT person was just here and she stated that we are using Home and Business 2021 but I found Office 16 when I clicked on Excel Properties. Am I crazy?
 
Upvote 0
If you have 2021, then you could use this in A2 only (clear column A first)
Excel Formula:
=LET(r,ROWS(Sheet1!B2:B100),a,MMULT(--(SEQUENCE(r)>=SEQUENCE(,r)),--Sheet1!B2:B100),XLOOKUP(SEQUENCE(MAX(a)),a,Sheet1!A2:A100,,1))
 
Upvote 0
=LET(r,ROWS(Sheet1!B2:B100),a,MMULT(--(SEQUENCE(r)>=SEQUENCE(,r)),--Sheet1!B2:B100),XLOOKUP(SEQUENCE(MAX(a)),a,Sheet1!A2:A100,,1))

It worked so I must have 2021! I learn something new everyday!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,421
Messages
6,124,806
Members
449,191
Latest member
rscraig11

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